Skip to content

Commit 50a920b

Browse files
committed
add void restart(void) and uint16_t getVCC(void) to Esp class
1 parent 6e223ce commit 50a920b

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp

+13-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ void EspClass::wdtEnable(int)
4040
ets_wdt_enable();
4141
}
4242

43-
void EspClass::wdtDisable()
43+
void EspClass::wdtDisable(void)
4444
{
4545
ets_wdt_disable();
4646
}
4747

48-
void EspClass::wdtFeed()
48+
void EspClass::wdtFeed(void)
4949
{
5050
wdt_feed();
5151
}
@@ -56,7 +56,17 @@ void EspClass::deepSleep(uint32_t time_us, WakeMode mode)
5656
system_deep_sleep(time_us);
5757
}
5858

59-
void EspClass::reset()
59+
void EspClass::reset(void)
6060
{
6161
((void (*)(void))0x40000080)();
6262
}
63+
64+
void EspClass::restart(void)
65+
{
66+
system_restart();
67+
}
68+
69+
uint16_t EspClass::getVCC(void)
70+
{
71+
return system_get_vdd33();
72+
}

hardware/esp8266com/esp8266/cores/esp8266/Esp.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ class EspClass {
3535

3636
void wdtEnable(int timeout_ms = 0);
3737
// TODO: figure out how to set WDT timeout
38-
void wdtDisable();
39-
void wdtFeed();
38+
void wdtDisable(void);
39+
void wdtFeed(void);
4040

4141
void deepSleep(uint32_t time_us, WakeMode mode = WAKE_RF_DEFAULT);
4242

43-
void reset();
43+
44+
void reset(void);
45+
void restart(void);
46+
uint16_t getVCC(void);
4447
};
4548

4649
extern EspClass ESP;

0 commit comments

Comments
 (0)