Skip to content

Commit

Permalink
Allow not to use vTaskDelete() (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonWong committed Mar 1, 2023
1 parent 07aae04 commit 698a1f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions freertos-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ name = "freertos_rust"
path = "src/lib.rs"

[features]
default = ["allocator", "sync", "time", "hooks", "interrupt"]
default = ["allocator", "sync", "time", "hooks", "interrupt", "delete_task"]
allocator = []
sync = ["interrupt"]
time = ["interrupt"]
hooks = []
interrupt = []
cpu_clock = []
cpu_clock = []
delete_task = []
6 changes: 5 additions & 1 deletion freertos-rust/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ impl Task {
});
}

#[cfg(feature = "delete_task")]
freertos_rs_delete_task(0 as *const _);
}

0 as *mut _
#[cfg(feature = "delete_task")]
return 0 as *mut _;
#[cfg(not(feature = "delete_task"))]
panic!("Not allowed to quit the task!");
}

Ok(Task {
Expand Down

0 comments on commit 698a1f1

Please sign in to comment.