pub unsafe extern "C" fn esp_pm_lock_acquire(
    handle: esp_pm_lock_handle_t
) -> esp_err_t
Expand description

@brief Take a power management lock

Once the lock is taken, power management algorithm will not switch to the mode specified in a call to esp_pm_lock_create, or any of the lower power modes (higher numeric values of ‘mode’).

The lock is recursive, in the sense that if esp_pm_lock_acquire is called a number of times, esp_pm_lock_release has to be called the same number of times in order to release the lock.

This function may be called from an ISR.

This function is not thread-safe w.r.t. calls to other esp_pm_lock_* functions for the same handle.

@param handle handle obtained from esp_pm_lock_create function @return - ESP_OK on success - ESP_ERR_INVALID_ARG if the handle is invalid - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig