mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
add void restart(void) and uint16_t getVCC(void) to Esp class
This commit is contained in:
parent
0bfd5cb396
commit
6cf87708c5
@ -40,12 +40,12 @@ void EspClass::wdtEnable(int)
|
|||||||
ets_wdt_enable();
|
ets_wdt_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspClass::wdtDisable()
|
void EspClass::wdtDisable(void)
|
||||||
{
|
{
|
||||||
ets_wdt_disable();
|
ets_wdt_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspClass::wdtFeed()
|
void EspClass::wdtFeed(void)
|
||||||
{
|
{
|
||||||
wdt_feed();
|
wdt_feed();
|
||||||
}
|
}
|
||||||
@ -56,7 +56,17 @@ void EspClass::deepSleep(uint32_t time_us, WakeMode mode)
|
|||||||
system_deep_sleep(time_us);
|
system_deep_sleep(time_us);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspClass::reset()
|
void EspClass::reset(void)
|
||||||
{
|
{
|
||||||
((void (*)(void))0x40000080)();
|
((void (*)(void))0x40000080)();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EspClass::restart(void)
|
||||||
|
{
|
||||||
|
system_restart();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t EspClass::getVCC(void)
|
||||||
|
{
|
||||||
|
return system_get_vdd33();
|
||||||
|
}
|
||||||
|
@ -35,12 +35,15 @@ class EspClass {
|
|||||||
|
|
||||||
void wdtEnable(int timeout_ms = 0);
|
void wdtEnable(int timeout_ms = 0);
|
||||||
// TODO: figure out how to set WDT timeout
|
// TODO: figure out how to set WDT timeout
|
||||||
void wdtDisable();
|
void wdtDisable(void);
|
||||||
void wdtFeed();
|
void wdtFeed(void);
|
||||||
|
|
||||||
void deepSleep(uint32_t time_us, WakeMode mode = WAKE_RF_DEFAULT);
|
void deepSleep(uint32_t time_us, WakeMode mode = WAKE_RF_DEFAULT);
|
||||||
|
|
||||||
void reset();
|
|
||||||
|
void reset(void);
|
||||||
|
void restart(void);
|
||||||
|
uint16_t getVCC(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern EspClass ESP;
|
extern EspClass ESP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user