HW-independent ClearEepromConfig, substitutes #314
This commit is contained in:
@@ -48,8 +48,10 @@
|
|||||||
//#undef F
|
//#undef F
|
||||||
//#define F(x) (x)
|
//#define F(x) (x)
|
||||||
#include "core/MyHwESP8266.cpp"
|
#include "core/MyHwESP8266.cpp"
|
||||||
// For ESP8266, we always enable gateway feature
|
// Enable gateway feature
|
||||||
#define MY_GATEWAY_ESP8266
|
#if !defined(MY_CORE_ONLY)
|
||||||
|
#define MY_GATEWAY_ESP8266
|
||||||
|
#endif
|
||||||
#elif defined(ARDUINO_ARCH_AVR)
|
#elif defined(ARDUINO_ARCH_AVR)
|
||||||
#include "core/MyHwATMega328.cpp"
|
#include "core/MyHwATMega328.cpp"
|
||||||
#elif defined(ARDUINO_ARCH_SAMD)
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
@@ -219,22 +221,24 @@
|
|||||||
#undef MY_INCLUSION_BUTTON_FEATURE
|
#undef MY_INCLUSION_BUTTON_FEATURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MY_GATEWAY_FEATURE) && !defined(MY_RADIO_FEATURE)
|
#if !defined(MY_CORE_ONLY)
|
||||||
#error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
|
#if !defined(MY_GATEWAY_FEATURE) && !defined(MY_RADIO_FEATURE)
|
||||||
|
#error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "core/MyCapabilities.h"
|
#include "core/MyCapabilities.h"
|
||||||
#include "core/MyMessage.cpp"
|
#include "core/MyMessage.cpp"
|
||||||
#include "core/MySensorCore.cpp"
|
#include "core/MySensorCore.cpp"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if defined(MY_GATEWAY_ESP8266)
|
#if !defined(MY_CORE_ONLY)
|
||||||
#include "core/MyMainESP8266.cpp"
|
#if defined(MY_GATEWAY_ESP8266)
|
||||||
#else
|
#include "core/MyMainESP8266.cpp"
|
||||||
#include "core/MyMainDefault.cpp"
|
#else
|
||||||
|
#include "core/MyMainDefault.cpp"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -23,16 +23,18 @@
|
|||||||
* This sketch clears radioId, relayId and other routing information in EEPROM back to factory default
|
* This sketch clears radioId, relayId and other routing information in EEPROM back to factory default
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
// load core modules only
|
||||||
|
#define MY_CORE_ONLY
|
||||||
|
|
||||||
#include <MyConfig.h>
|
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
#include <MySensor.h>
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(MY_BAUD_RATE);
|
Serial.begin(MY_BAUD_RATE);
|
||||||
Serial.println("Started clearing. Please wait...");
|
Serial.println("Started clearing. Please wait...");
|
||||||
for (int i=0;i<512;i++) {
|
for (int i=0;i<EEPROM_LOCAL_CONFIG_ADDRESS;i++) {
|
||||||
EEPROM.write(i, 0xff);
|
hwWriteConfig(i,0xFF);
|
||||||
}
|
}
|
||||||
Serial.println("Clearing done. You're ready to go!");
|
Serial.println("Clearing done. You're ready to go!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,3 +110,4 @@ MY_DISABLE_REMOTE_RESET LITERAL1
|
|||||||
MY_RS485_DE_PIN LITERAL1
|
MY_RS485_DE_PIN LITERAL1
|
||||||
MY_SIGNING_REQUEST_SIGNATURES LITERAL1
|
MY_SIGNING_REQUEST_SIGNATURES LITERAL1
|
||||||
MY_SMART_SLEEP_WAIT_DURATION LITERAL1
|
MY_SMART_SLEEP_WAIT_DURATION LITERAL1
|
||||||
|
MY_CORE_ONLY LITERAL1
|
||||||
Reference in New Issue
Block a user