[][src]Function rpi_pico_sdk_sys::alarm_pool_add_alarm_at

pub unsafe extern "C" fn alarm_pool_add_alarm_at(
    pool: *mut alarm_pool_t,
    time: absolute_time_t,
    callback: alarm_callback_t,
    user_data: *mut c_void,
    fire_if_past: bool
) -> alarm_id_t

\brief Add an alarm callback to be called at a specific time \ingroup alarm

Generally the callback is called as soon as possible after the time specified from an IRQ handler on the core the alarm pool was created on. If the callback is in the past or happens before the alarm setup could be completed, then this method will optionally call the callback itself and then return a return code to indicate that the target time has passed.

\note It is safe to call this method from an IRQ handler (including alarm callbacks), and from either core.

@param pool the alarm pool to use for scheduling the callback (this determines which hardware alarm is used, and which core calls the callback) @param time the timestamp when (after which) the callback should fire @param callback the callback function @param user_data user data to pass to the callback function @param fire_if_past if true, this method will call the callback itself before returning 0 if the timestamp happens before or during this method call @return >0 the alarm id @return 0 the target timestamp was during or before this method call (whether the callback was called depends on fire_if_past) @return -1 if there were no alarm slots available