Commit 41a5736d authored by dnc40085's avatar dnc40085 Committed by Marcel Stör
Browse files

Add wifi.suspend() and node.sleep() (#1231)

* Exposed forced sleep API and more
Added timer suspend functionality
* wifi.suspend
* wifi.resume
* node.sleep 
* tmr.suspend
* tmr.suspend_all
* tmr.resume
* tmr.resume_all
* Implement timer suspend functionality
* Fix for uart TX glitch
* Made some modifications to the error reporting
parent 176443c0
...@@ -16,4 +16,15 @@ void call_user_start(void); ...@@ -16,4 +16,15 @@ void call_user_start(void);
#include_next "osapi.h" #include_next "osapi.h"
#ifdef ENABLE_TIMER_SUSPEND
extern void swtmr_register(void* timer_ptr);
#undef os_timer_arm
#define os_timer_arm(timer_ptr, duration, mode) do{swtmr_register(timer_ptr); \
ets_timer_arm_new(timer_ptr, duration, mode, 1);}while(0);
extern void swtmr_unregister(void* timer_ptr);
#undef os_timer_disarm
#define os_timer_disarm(timer_ptr) do{swtmr_unregister(timer_ptr); ets_timer_disarm(timer_ptr);}while(0);
#endif
#endif #endif
...@@ -15,4 +15,13 @@ enum ext_flash_size_map { ...@@ -15,4 +15,13 @@ enum ext_flash_size_map {
// Documented in section 4.5 of 9b-esp8266_low_power_solutions_en.pdf // Documented in section 4.5 of 9b-esp8266_low_power_solutions_en.pdf
void system_deep_sleep_instant(uint32 time_in_us); void system_deep_sleep_instant(uint32 time_in_us);
//force sleep API
#define FPM_SLEEP_MAX_TIME 268435455 //0xFFFFFFF
void wifi_fpm_set_wakeup_cb(void (*fpm_wakeup_cb_func)(void));
bool fpm_is_open(void);
bool fpm_rf_is_closed(void);
uint8 get_fpm_auto_sleep_flag(void);
#endif /* SDK_OVERRIDES_INCLUDE_USER_INTERFACE_H_ */ #endif /* SDK_OVERRIDES_INCLUDE_USER_INTERFACE_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment