Skip to main content

work_handler

Macro work_handler 

Source
macro_rules! work_handler {
    ($f:ident) => { ... };
}
Expand description

Wrap a safe Rust fn() into an ove_work_fn C trampoline.

The oveRTOS C work handler has no user_data slot, so this just generates a unsafe extern "C" trampoline that calls the supplied safe function. Use this with crate::work! so app code never has to write unsafe extern "C" itself.

§Example

fn on_work() { /* ... */ }
let w = ove::work!(ove::work_handler!(on_work));