diff --git a/Binaries/OpenLog_Artemis-V10-v28_BETA.bin b/Binaries/OpenLog_Artemis-V10-v28_BETA.bin deleted file mode 100644 index 67aed40..0000000 Binary files a/Binaries/OpenLog_Artemis-V10-v28_BETA.bin and /dev/null differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c451df..72dbe56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ v2.8: * Corrects the serial token timestamp printing - resolves #192 * The charsReceived debug print ("Total chars received: ") now excludes the length of the timestamps +* Consistent use of File32/ExFile/FsFile/File. Don't use SdFile for temporary files v2.7: --------- diff --git a/Firmware/OpenLog_Artemis/OpenLog_Artemis.ino b/Firmware/OpenLog_Artemis/OpenLog_Artemis.ino index 8f755c6..a7e5b26 100644 --- a/Firmware/OpenLog_Artemis/OpenLog_Artemis.ino +++ b/Firmware/OpenLog_Artemis/OpenLog_Artemis.ino @@ -158,6 +158,7 @@ v2.8: Corrects the serial token timestamp printing - resolves #192 The charsReceived debug print ("Total chars received: ") now excludes the length of the timestamps + Consistent use of File32/ExFile/FsFile/File. Don't use SdFile for temporary files */ diff --git a/Firmware/OpenLog_Artemis/logging.ino b/Firmware/OpenLog_Artemis/logging.ino index e7c1f06..d4d361f 100644 --- a/Firmware/OpenLog_Artemis/logging.ino +++ b/Firmware/OpenLog_Artemis/logging.ino @@ -11,7 +11,16 @@ void msg(const char * message) //Updates EEPROM and then appends to the new log file. char* findNextAvailableLog(int &newFileNumber, const char *fileLeader) { - SdFile newFile; //This will contain the file for SD writing + //This will contain the file for SD writing + #if SD_FAT_TYPE == 1 + File32 newFile; + #elif SD_FAT_TYPE == 2 + ExFile newFile; + #elif SD_FAT_TYPE == 3 + FsFile newFile; + #else // SD_FAT_TYPE == 0 + File newFile; + #endif // SD_FAT_TYPE if (newFileNumber < 2) //If the settings have been reset, let's warn the user that this could take a while! { diff --git a/Firmware/OpenLog_Artemis/nvm.ino b/Firmware/OpenLog_Artemis/nvm.ino index fea9329..692f70f 100644 --- a/Firmware/OpenLog_Artemis/nvm.ino +++ b/Firmware/OpenLog_Artemis/nvm.ino @@ -197,10 +197,19 @@ bool loadSystemSettingsFromFile() { if (sd.exists("OLA_settings.txt")) { - SdFile settingsFile; //FAT32 + #if SD_FAT_TYPE == 1 + File32 settingsFile; + #elif SD_FAT_TYPE == 2 + ExFile settingsFile; + #elif SD_FAT_TYPE == 3 + FsFile settingsFile; + #else // SD_FAT_TYPE == 0 + File settingsFile; + #endif // SD_FAT_TYPE + if (settingsFile.open("OLA_settings.txt", O_READ) == false) { - SerialPrintln(F("Failed to open settings file")); + SerialPrintln(F("Failed to open device settings file")); return (false); } diff --git a/Firmware/OpenLog_Artemis/productionTest.ino b/Firmware/OpenLog_Artemis/productionTest.ino index ec17ba3..9133a10 100644 --- a/Firmware/OpenLog_Artemis/productionTest.ino +++ b/Firmware/OpenLog_Artemis/productionTest.ino @@ -488,7 +488,16 @@ void productionTest() if (sd.exists("OLA_prod_test.txt")) sd.remove("OLA_prod_test.txt"); - SdFile testFile; //FAT32 + #if SD_FAT_TYPE == 1 + File32 testFile; + #elif SD_FAT_TYPE == 2 + ExFile testFile; + #elif SD_FAT_TYPE == 3 + FsFile testFile; + #else // SD_FAT_TYPE == 0 + File testFile; + #endif // SD_FAT_TYPE + if (testFile.open("OLA_prod_test.txt", O_CREAT | O_APPEND | O_WRITE) == true) { #ifdef verboseProdTest diff --git a/Firmware/OpenLog_Artemis/zmodem.h b/Firmware/OpenLog_Artemis/zmodem.h index 073f2d0..154f201 100644 --- a/Firmware/OpenLog_Artemis/zmodem.h +++ b/Firmware/OpenLog_Artemis/zmodem.h @@ -169,7 +169,7 @@ _PROTOTYPE(void bibi , (int n )); _PROTOTYPE(int wcs , (const char *oname)); _PROTOTYPE(void saybibi, (void)); -int wctxpn(char *name,SdFile *file); +int wctxpn(char *name); int wcrx(); /* Ward Christensen / CP/M parameters - Don't change these! */ diff --git a/Firmware/OpenLog_Artemis/zmodem.ino b/Firmware/OpenLog_Artemis/zmodem.ino index aefb0c2..6e517d4 100644 --- a/Firmware/OpenLog_Artemis/zmodem.ino +++ b/Firmware/OpenLog_Artemis/zmodem.ino @@ -129,7 +129,15 @@ V2.00 extern int Filesleft; extern long Totalleft; -extern SdFile fout; +#if SD_FAT_TYPE == 1 +extern File32 fout; +#elif SD_FAT_TYPE == 2 +extern ExFile fout; +#elif SD_FAT_TYPE == 3 +extern FsFile fout; +#else // SD_FAT_TYPE == 0 +extern File fout; +#endif // SD_FAT_TYPE static bool oneTime = false; // Display the Tera Term Change Directory note only once (so it does not get on people's nerves!) @@ -171,9 +179,19 @@ void sdCardHelp(void) DSERIALprint(F("\r\n")); } -SdFile root; // Copied from SdFat OpenNext example -SdFile fout; -//dir_t *dir ; +#if SD_FAT_TYPE == 1 +File32 root; +File32 fout; +#elif SD_FAT_TYPE == 2 +ExFile root; +ExFile fout; +#elif SD_FAT_TYPE == 3 +FsFile root; +FsFile fout; +#else // SD_FAT_TYPE == 0 +File root; +File fout; +#endif // SD_FAT_TYPE int count_files(int *file_count, long *byte_count) { diff --git a/Firmware/OpenLog_Artemis/zmodem_rz.cpp b/Firmware/OpenLog_Artemis/zmodem_rz.cpp index c6b06f8..c51a648 100644 --- a/Firmware/OpenLog_Artemis/zmodem_rz.cpp +++ b/Firmware/OpenLog_Artemis/zmodem_rz.cpp @@ -133,7 +133,15 @@ _PROTOTYPE(void bttyout , (int c )); #ifndef ARDUINO FILE *fout; #else -extern SdFile fout; +#if SD_FAT_TYPE == 1 +extern File32 fout; +#elif SD_FAT_TYPE == 2 +extern ExFile fout; +#elif SD_FAT_TYPE == 3 +extern FsFile fout; +#else // SD_FAT_TYPE == 0 +extern File fout; +#endif // SD_FAT_TYPE #endif // Dylan (monte_carlo_ecm, bitflipper, etc.) - Moved this to a global variable to enable diff --git a/Firmware/OpenLog_Artemis/zmodem_sz.cpp b/Firmware/OpenLog_Artemis/zmodem_sz.cpp index d52ec27..c84c4f1 100644 --- a/Firmware/OpenLog_Artemis/zmodem_sz.cpp +++ b/Firmware/OpenLog_Artemis/zmodem_sz.cpp @@ -188,7 +188,15 @@ _PROTOTYPE(int zsendcmd , (char *buf , int blen )); #ifndef ARDUINO FILE *fout; #else -extern SdFile fout; +#if SD_FAT_TYPE == 1 +extern File32 fout; +#elif SD_FAT_TYPE == 2 +extern ExFile fout; +#elif SD_FAT_TYPE == 3 +extern FsFile fout; +#else // SD_FAT_TYPE == 0 +extern File fout; +#endif // SD_FAT_TYPE #endif int wcs(const char *oname)