Skip to content

Commit ba661f8

Browse files
committed
Bugfix: InterruptContext used non-ISR function in drop
`freertos_rs_isr_yield()` used `portYIELD()` instead of `portYIELD_FROM_ISR()`.
1 parent 59b0a36 commit ba661f8

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

freertos-rust/src/freertos/shim.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ UBaseType_t freertos_rs_queue_messages_waiting(QueueHandle_t queue) {
277277
return uxQueueMessagesWaiting( queue );
278278
}
279279

280-
void freertos_rs_isr_yield() {
281-
portYIELD();
280+
void freertos_rs_isr_yield(BaseType_t xHigherPriorityTaskWoken) {
281+
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
282282
}
283283

284284
TickType_t freertos_rs_max_wait() {

freertos-rust/src/isr.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ impl InterruptContext {
2727

2828
impl Drop for InterruptContext {
2929
fn drop(&mut self) {
30-
if self.x_higher_priority_task_woken == 1 {
31-
unsafe {
32-
freertos_rs_isr_yield();
33-
}
30+
unsafe {
31+
freertos_rs_isr_yield(self.x_higher_priority_task_woken);
3432
}
3533
}
3634
}

freertos-rust/src/shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern "C" {
8181
item: FreeRtosVoidPtr,
8282
xHigherPriorityTaskWoken: FreeRtosBaseTypeMutPtr,
8383
) -> FreeRtosUBaseType;
84-
pub fn freertos_rs_isr_yield();
84+
pub fn freertos_rs_isr_yield(xHigherPriorityTaskWoken: FreeRtosBaseType);
8585

8686
pub fn freertos_rs_task_notify_take(clear_count: u8, wait: FreeRtosTickType) -> u32;
8787
pub fn freertos_rs_task_notify_wait(

0 commit comments

Comments
 (0)