Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: InterruptContext used non-ISR function in drop #78

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions freertos-rust/src/freertos/shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ UBaseType_t freertos_rs_queue_messages_waiting(QueueHandle_t queue) {
return uxQueueMessagesWaiting( queue );
}

void freertos_rs_isr_yield() {
portYIELD();
void freertos_rs_isr_yield(BaseType_t xHigherPriorityTaskWoken) {
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}

TickType_t freertos_rs_max_wait() {
Expand Down
6 changes: 2 additions & 4 deletions freertos-rust/src/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ impl InterruptContext {

impl Drop for InterruptContext {
fn drop(&mut self) {
if self.x_higher_priority_task_woken == 1 {
unsafe {
freertos_rs_isr_yield();
}
unsafe {
freertos_rs_isr_yield(self.x_higher_priority_task_woken);
}
}
}
2 changes: 1 addition & 1 deletion freertos-rust/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extern "C" {
item: FreeRtosVoidPtr,
xHigherPriorityTaskWoken: FreeRtosBaseTypeMutPtr,
) -> FreeRtosUBaseType;
pub fn freertos_rs_isr_yield();
pub fn freertos_rs_isr_yield(xHigherPriorityTaskWoken: FreeRtosBaseType);

pub fn freertos_rs_task_notify_take(clear_count: u8, wait: FreeRtosTickType) -> u32;
pub fn freertos_rs_task_notify_wait(
Expand Down
Loading