1use crate::base::*;
2use crate::shim::*;
3
4pub struct InterruptContext {
9 x_higher_priority_task_woken: FreeRtosBaseType,
10}
11
12impl InterruptContext {
13 pub fn new() -> InterruptContext {
15 InterruptContext { x_higher_priority_task_woken: 0 }
16 }
17
18 pub unsafe fn get_task_field_mut(&self) -> FreeRtosBaseTypeMutPtr {
19 self.x_higher_priority_task_woken as *mut _
20 }
21}
22
23impl Drop for InterruptContext {
24 fn drop(&mut self) {
25 if self.x_higher_priority_task_woken == 1 {
26 unsafe { freertos_rs_isr_yield(); }
27 }
28 }
29}