mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Fix halRestart
This commit is contained in:
parent
1e25a8e17b
commit
01d23a33d4
@ -298,7 +298,7 @@ void dispatchReboot(bool saveConfig)
|
||||
Log.verbose(F("-------------------------------------"));
|
||||
Log.notice(F("STOP: Properly Rebooting the MCU now!"));
|
||||
Serial.flush();
|
||||
//halRestart();
|
||||
halRestart();
|
||||
}
|
||||
|
||||
void dispatch_button(uint8_t id, const char * event)
|
||||
|
@ -11,15 +11,6 @@
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include <rom/rtc.h> // needed to get the ResetInfo
|
||||
|
||||
void halRestart(void)
|
||||
{
|
||||
#if defined(ESP32) || defined(ESP8266)
|
||||
ESP.restart();
|
||||
#else
|
||||
NVIC_SystemReset();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Compatibility function for ESP8266 getRestInfo
|
||||
String esp32ResetReason(uint8_t cpuid)
|
||||
{
|
||||
@ -90,6 +81,15 @@ String esp32ResetReason(uint8_t cpuid)
|
||||
}
|
||||
#endif
|
||||
|
||||
void halRestart(void)
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||
ESP.restart();
|
||||
#else
|
||||
NVIC_SystemReset();
|
||||
#endif
|
||||
}
|
||||
|
||||
String halGetResetInfo()
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
void halRestart(void);
|
||||
uint8_t halGetHeapFragmentation(void);
|
||||
String halGetResetInfo(void);
|
||||
size_t halGetMaxFreeBlock(void);
|
||||
size_t halGetFreeHeap(void);
|
||||
String halGetCoreVersion(void);
|
||||
String halGetChipModel();
|
||||
void halRestart(void);
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user