Fix timer callback type

- Closes #1166
- `TimerCallback` has type: `Box<dyn FnMut() -> u32 + 'a + Send>`
This commit is contained in:
Jay Oster
2021-12-01 07:34:23 -08:00
parent fe411c6b87
commit 7b97dfd651
+1 -1
View File
@@ -88,7 +88,7 @@ impl<'b, 'a> Drop for Timer<'b, 'a> {
}
extern "C" fn c_timer_callback(_interval: u32, param: *mut c_void) -> u32 {
let f = param as *mut std::boxed::Box<dyn std::ops::Fn() -> u32>;
let f = param as *mut TimerCallback<'_>;
unsafe { (*f)() }
}