Made resetreason methods static
This commit is contained in:
parent
ee4811bbe7
commit
7538b4363c
@ -20,7 +20,7 @@
|
|||||||
#include "rom/rtc.h"
|
#include "rom/rtc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
String ResetReasonClass::get_reset_reason_verbose(uint8_t cpu_id)
|
String ResetReason::get_reset_reason_verbose(uint8_t cpu_id)
|
||||||
{
|
{
|
||||||
RESET_REASON reason;
|
RESET_REASON reason;
|
||||||
reason = rtc_get_reset_reason(cpu_id);
|
reason = rtc_get_reset_reason(cpu_id);
|
||||||
@ -86,7 +86,7 @@ String ResetReasonClass::get_reset_reason_verbose(uint8_t cpu_id)
|
|||||||
return reason_str;
|
return reason_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
String ResetReasonClass::get_reset_reason_short(uint8_t cpu_id)
|
String ResetReason::get_reset_reason_short(uint8_t cpu_id)
|
||||||
{
|
{
|
||||||
RESET_REASON reason;
|
RESET_REASON reason;
|
||||||
reason = rtc_get_reset_reason(cpu_id);
|
reason = rtc_get_reset_reason(cpu_id);
|
||||||
@ -151,5 +151,3 @@ String ResetReasonClass::get_reset_reason_short(uint8_t cpu_id)
|
|||||||
|
|
||||||
return reason_str;
|
return reason_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetReasonClass ResetReason;
|
|
||||||
|
|||||||
@ -3,10 +3,8 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
class ResetReasonClass {
|
class ResetReason {
|
||||||
public:
|
public:
|
||||||
String get_reset_reason_verbose(uint8_t cpu_id);
|
static String get_reset_reason_verbose(uint8_t cpu_id);
|
||||||
String get_reset_reason_short(uint8_t cpu_id);
|
static String get_reset_reason_short(uint8_t cpu_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ResetReasonClass ResetReason;
|
|
||||||
@ -55,10 +55,10 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
|||||||
root["chipcores"] = ESP.getChipCores();
|
root["chipcores"] = ESP.getChipCores();
|
||||||
|
|
||||||
String reason;
|
String reason;
|
||||||
reason = ResetReason.get_reset_reason_verbose(0);
|
reason = ResetReason::get_reset_reason_verbose(0);
|
||||||
root["resetreason_0"] = reason;
|
root["resetreason_0"] = reason;
|
||||||
|
|
||||||
reason = ResetReason.get_reset_reason_verbose(1);
|
reason = ResetReason::get_reset_reason_verbose(1);
|
||||||
root["resetreason_1"] = reason;
|
root["resetreason_1"] = reason;
|
||||||
|
|
||||||
root["cfgsavecount"] = Configuration.get().Cfg.SaveCount;
|
root["cfgsavecount"] = Configuration.get().Cfg.SaveCount;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user