Closed bradjc closed 1 year ago
One convention in Tock is that the first argument of an upcall is a return code. A return code is an ErrorCode but 0 means Success.
ErrorCode
This makes it possible to write a subscribe callback like:
let called: Cell<Option<Result<(), ErrorCode>>> = Cell::new(None); let called: Cell<Option<Result<(u32,), ErrorCode>>> = Cell::new(None); let called: Cell<Option<Result<(u32, u32), ErrorCode>>> = Cell::new(None);
My implementation of converting a u32 to an errorcode is functional but not great, any ideas on what that should look like?
One convention in Tock is that the first argument of an upcall is a return code. A return code is an
ErrorCode
but 0 means Success.This makes it possible to write a subscribe callback like:
My implementation of converting a u32 to an errorcode is functional but not great, any ideas on what that should look like?