mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-23 08:45:22 +03:00
Merge remote-tracking branch 'remotes/esp8266/esp8266' into esp8266
Conflicts: hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp
This commit is contained in:
@ -32,13 +32,7 @@ extern struct rst_info resetInfo;
|
||||
|
||||
// #define DEBUG_SERIAL Serial
|
||||
|
||||
//extern "C" void ets_wdt_init(uint32_t val);
|
||||
extern "C" void ets_wdt_enable(void);
|
||||
extern "C" void ets_wdt_disable(void);
|
||||
extern "C" void wdt_feed(void) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* User-defined Literals
|
||||
* usage:
|
||||
@ -85,30 +79,20 @@ unsigned long long operator"" _GB(unsigned long long x) {
|
||||
|
||||
EspClass ESP;
|
||||
|
||||
EspClass::EspClass()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void EspClass::wdtEnable(uint32_t timeout_ms)
|
||||
{
|
||||
//todo find doku for ets_wdt_init may set the timeout
|
||||
ets_wdt_enable();
|
||||
}
|
||||
|
||||
void EspClass::wdtEnable(WDTO_t timeout_ms)
|
||||
{
|
||||
wdtEnable((uint32_t) timeout_ms);
|
||||
}
|
||||
|
||||
void EspClass::wdtDisable(void)
|
||||
{
|
||||
ets_wdt_disable();
|
||||
}
|
||||
|
||||
void EspClass::wdtFeed(void)
|
||||
{
|
||||
wdt_feed();
|
||||
}
|
||||
|
||||
void EspClass::deepSleep(uint32_t time_us, WakeMode mode)
|
||||
@ -117,18 +101,20 @@ void EspClass::deepSleep(uint32_t time_us, WakeMode mode)
|
||||
system_deep_sleep(time_us);
|
||||
}
|
||||
|
||||
extern "C" void esp_yield();
|
||||
extern "C" void __real_system_restart_local();
|
||||
void EspClass::reset(void)
|
||||
{
|
||||
((void (*)(void))0x40000080)();
|
||||
__real_system_restart_local();
|
||||
}
|
||||
|
||||
void EspClass::restart(void)
|
||||
{
|
||||
system_restart();
|
||||
delay(5000);
|
||||
system_restart();
|
||||
delay(20000);
|
||||
reset(); // if we still have not reset force it!
|
||||
esp_yield();
|
||||
// todo: provide an alternative code path if this was called
|
||||
// from system context, not from continuation
|
||||
// (implement esp_is_cont_ctx()?)
|
||||
}
|
||||
|
||||
uint16_t EspClass::getVcc(void)
|
||||
|
Reference in New Issue
Block a user