Skip to content

Commit

Permalink
Fix GPS load/save ephems
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed May 8, 2020
1 parent 4ded379 commit a7bbdc1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libraries/GPS/WaspGPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2457,9 +2457,13 @@ int8_t WaspGPS::saveEphems(const char* filename)
uint8_t endFile[7] ={0xAA,0xBB,0xCC,0xCC,0xBB,0xAA,0xAA};

// First of all, prepare SD card.
SD.ON();
bool _SD_ON = (WaspRegister & REG_SD);
if (! _SD_ON)
{
SD.ON();
}

// check if the card is there or not
// check if the card is there or not
if (!SD.isSD())
{
#ifdef DEBUG_MODE
Expand Down Expand Up @@ -2588,7 +2592,10 @@ int8_t WaspGPS::saveEphems(const char* filename)
SD.append(filename, endFile, 7);

// Turn OFF SD card
SD.OFF();
if (! _SD_ON)
{
SD.OFF();
}

// Now change to NMEA mode
setCommMode(NMEA_MODE);
Expand Down

0 comments on commit a7bbdc1

Please sign in to comment.