Fix auto#.g file handling, add NO_SD_AUTOSTART (#20071)

This commit is contained in:
Scott Lahteine
2020-12-07 05:53:15 -06:00
committed by GitHub
parent b04914fb72
commit 7f20184ebc
9 changed files with 78 additions and 56 deletions

View File

@@ -90,10 +90,12 @@ public:
static void openLogFile(char * const path);
static void write_command(char * const buf);
// Auto-Start files
static int8_t autostart_index; // Index of autoX.g files
static void beginautostart();
static void checkautostart();
#if DISABLED(NO_SD_AUTOSTART) // Auto-Start auto#.g file handling
static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero.
static void autofile_begin(); // Begin check. Called automatically after boot-up.
static bool autofile_check(); // Check for the next auto-start file and run it.
static inline void autofile_cancel() { autofile_index = 0; }
#endif
// Basic file ops
static void openFileRead(char * const path, const uint8_t subcall=0);