You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I try to port some code form an Arduino Nano to an Feather M0 Cortex. I run into a problem with the get and put function. Is it not possible to use?
I run with #include <FlashAsEEPROM.h>
void loadEEPROMSettings() {
// Load settings from EEPROM to custom struct
EEPROM.get(0, txSettings);
bool rewriteSettings = false;
// Loop through all settings to check if everything is fine
for (uint8_t i = 0; i < numOfSettings; i++) {
// If setting default value is -1, don't check if its valid
if( rules[i][0] != -1 ){
short val = getSettingValue(i);
if (! inRange(val, rules[i][1], rules[i][2])) {
// Setting is damaged or never written. Rewrite default.
rewriteSettings = true;
setSettingValue(i, rules[i][0] );
}
}
}
if(txSettings.firmVersion != VERSION){
setDefaultEEPROMSettings();
}
else if (rewriteSettings == true) {
updateEEPROMSettings();
}
// Calculate constants
calculateRatios();
}
/*
* Write settings to the EEPROM then exiting settings menu.
*/
void updateEEPROMSettings() {
EEPROM.put(0, txSettings);
calculateRatios();
}
The text was updated successfully, but these errors were encountered:
I have no idea if this applies to you, but I had strange behaviors when I was using the Arduino IDE provided by the Synaptic Package Manager on Linux, and it was fixed by downloading and installing from arduino.cc.
Hi! I try to port some code form an Arduino Nano to an Feather M0 Cortex. I run into a problem with the get and put function. Is it not possible to use?
I run with
#include <FlashAsEEPROM.h>
The text was updated successfully, but these errors were encountered: