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 {
16 x_higher_priority_task_woken: 0,
17 }
18 }
19
20 pub fn get_task_field_mut(&mut self) -> FreeRtosBaseTypeMutPtr {
21 &mut self.x_higher_priority_task_woken as *mut _
22 }
23 pub fn higher_priority_task_woken(&self) -> FreeRtosBaseType {
24 self.x_higher_priority_task_woken
25 }
26}
27
28impl Drop for InterruptContext {
29 fn drop(&mut self) {
30 unsafe {
31 freertos_rs_isr_yield(self.x_higher_priority_task_woken);
32 }
33 }
34}