system_api: return error on repeated registration of shutdown handler

This commit is contained in:
Ivan Grokhotkov
2019-04-08 19:30:07 +08:00
parent bd309a133f
commit b1a722b2ca
2 changed files with 14 additions and 8 deletions

View File

@@ -80,6 +80,11 @@ typedef void (*shutdown_handler_t)(void);
*
* This function allows you to register a handler that gets invoked before
* the application is restarted using esp_restart function.
* @param handle function to execute on restart
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_STATE if the handler has already been registered
* - ESP_ERR_NO_MEM if no more shutdown handler slots are available
*/
esp_err_t esp_register_shutdown_handler(shutdown_handler_t handle);