112112 v2.2:
113113 Use Apollo3 v2.2.0 with changes by paulvha to fix Issue 117 (Thank you Paul!)
114114 https://github.com/sparkfun/OpenLog_Artemis/issues/117#issuecomment-1034973065
115+ Also includes Paul's SPI.end fix
116+ https://github.com/sparkfun/Arduino_Apollo3/issues/442
115117 Use SdFat v2.1.2
116118 Compensate for missing / not-populated IMU
117119 Add support for yyyy/mm/dd and ISO 8601 date style (Issue 118)
120+ Add support for fractional time zone offsets
118121*/
119122
120123const int FIRMWARE_VERSION_MAJOR = 2 ;
@@ -195,7 +198,7 @@ TwoWire qwiic(PIN_QWIIC_SDA,PIN_QWIIC_SCL); //Will use pads 8/9
195198// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
196199#include < SPI.h>
197200
198- #include < SdFat.h> // SdFat v2.0.7 by Bill Greiman: http://librarymanager/All#SdFat_exFAT
201+ #include < SdFat.h> // SdFat by Bill Greiman: http://librarymanager/All#SdFat_exFAT
199202
200203#define SD_FAT_TYPE 3 // SD_FAT_TYPE = 0 for SdFat/File, 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT.
201204#define SD_CONFIG SdSpiConfig (PIN_MICROSD_CHIP_SELECT, SHARED_SPI, SD_SCK_MHZ(24 )) // 24MHz
@@ -375,6 +378,8 @@ void setup() {
375378
376379 enableCIPOpullUp (); // Enable CIPO pull-up _after_ beginSD
377380
381+ beginIMU (); // 61ms
382+
378383 loadSettings (); // 50 - 250ms
379384
380385 if (settings.useTxRxPinsForTerminal == true )
@@ -439,8 +444,6 @@ void setup() {
439444 beginSerialOutput (); // Begin serial data output on the TX pin
440445 }
441446
442- beginIMU (); // 61ms
443-
444447 if (online.microSD == true ) SerialPrintln (F (" SD card online" ));
445448 else SerialPrintln (F (" SD card offline" ));
446449
@@ -1236,6 +1239,7 @@ void beginDataLogging()
12361239 }
12371240
12381241 updateDataFileCreate (&sensorDataFile); // Update the file create time & date
1242+ sensorDataFile.sync ();
12391243
12401244 online.dataLogging = true ;
12411245 }
@@ -1260,6 +1264,7 @@ void beginSerialLogging()
12601264 }
12611265
12621266 updateDataFileCreate (&serialDataFile); // Update the file create time & date
1267+ serialDataFile.sync ();
12631268
12641269 // We need to manually restore the Serial1 TX and RX pins
12651270 configureSerial1TxRx ();
0 commit comments