mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 04:36:38 +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.verbose(F("-------------------------------------"));
|
||||||
Log.notice(F("STOP: Properly Rebooting the MCU now!"));
|
Log.notice(F("STOP: Properly Rebooting the MCU now!"));
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
//halRestart();
|
halRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dispatch_button(uint8_t id, const char * event)
|
void dispatch_button(uint8_t id, const char * event)
|
||||||
|
@ -11,15 +11,6 @@
|
|||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include <rom/rtc.h> // needed to get the ResetInfo
|
#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
|
// Compatibility function for ESP8266 getRestInfo
|
||||||
String esp32ResetReason(uint8_t cpuid)
|
String esp32ResetReason(uint8_t cpuid)
|
||||||
{
|
{
|
||||||
@ -90,6 +81,15 @@ String esp32ResetReason(uint8_t cpuid)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void halRestart(void)
|
||||||
|
{
|
||||||
|
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
|
||||||
|
ESP.restart();
|
||||||
|
#else
|
||||||
|
NVIC_SystemReset();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
String halGetResetInfo()
|
String halGetResetInfo()
|
||||||
{
|
{
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
void halRestart(void);
|
||||||
uint8_t halGetHeapFragmentation(void);
|
uint8_t halGetHeapFragmentation(void);
|
||||||
String halGetResetInfo(void);
|
String halGetResetInfo(void);
|
||||||
size_t halGetMaxFreeBlock(void);
|
size_t halGetMaxFreeBlock(void);
|
||||||
size_t halGetFreeHeap(void);
|
size_t halGetFreeHeap(void);
|
||||||
String halGetCoreVersion(void);
|
String halGetCoreVersion(void);
|
||||||
String halGetChipModel();
|
String halGetChipModel();
|
||||||
void halRestart(void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user