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