pub unsafe extern "C" fn esp_register_freertos_idle_hook_for_cpu(
    new_idle_cb: Option<unsafe extern "C" fn() -> bool>,
    cpuid: u32,
) -> i32
Expand description

@brief Register a callback to be called from the specified core’s idle hook. The callback should return true if it should be called by the idle hook once per interrupt (or FreeRTOS tick), and return false if it should be called repeatedly as fast as possible by the idle hook.

@warning Idle callbacks MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK.

@param[in] new_idle_cb Callback to be called @param[in] cpuid id of the core

@return - ESP_OK: Callback registered to the specified core’s idle hook - ESP_ERR_NO_MEM: No more space on the specified core’s idle hook to register callback - ESP_ERR_INVALID_ARG: cpuid is invalid