woodencase01
Member
I've been trying to delete a file if a version number doesn't match. Below is a part from the code (link to github below):
For some reasons, I have the following error message when compiling:
I tried changing the variable types without success. Even the commented line doesn't work.
Here is my current set-up:
Code:
#include <SD.h>
...
const char CONFIG_FILE[] = "CONFIG.CFG";
const uint8_t HEADER_VERSION = 1;
configFile = SD.open(CONFIG_FILE, FILE_WRITE);
...
if (configFile)
{
DEBUG_PRINTLN("CONFIG Present.");
configFile.seek(0);
// Check for version
configFile.readStringUntil(',');
int version = configFile.readStringUntil('\n').toInt();
if (version < HEADER_VERSION)
{
// Wrong version, create new file
DEBUG_PRINTLN("Too old version, recreating file...");
SD.remove(CONFIG_FILE);
//SD.remove("CONFIG.CFG");
...
For some reasons, I have the following error message when compiling:
Code:
.pio\build\teensy31\src\main.cpp.o: In function `initConfig()':
main.cpp:(.text._Z10initConfigv+0x116): undefined reference to `SDClass::remove(char const*)'
I tried changing the variable types without success. Even the commented line doesn't work.
Here is my current set-up:
- Teensy 3.2
- PlatformIO with VSCode
- Complete code: https://github.com/woodencase01/DrumModule