esp_sleep_register_event_callback() function
Register event callbacks for light sleep internal events (if CONFIG_FREERTOS_USE_TICKLESS_IDLE)
Arguments
event_id
Designed to register the corresponding event_cb in g_sleep_event_cbs_config
event_cb_conf
Config struct containing event callback function and corresponding argument
Return value
- ESP_OK on success - ESP_ERR_INVALID_ARG if the input parameter event_cb_conf is NULL or event_id is out of range - ESP_ERR_NO_MEM if the remaining memory is insufficient to support malloc - ESP_FAIL if register the same function repeatedly
Notes
Some of these callback functions are called from IDLE task context hence they cannot call any blocking functions Passing NULL value will not deregister the callbacks, it will silently ignore and return ESP_OK