Closed JalonWong closed 1 year ago
I don't like the approach of modifying the internals of the function - if the user was trying to not include it, but the function is still available from the Rust side, it could result in some weird behavior for them. I'd much rather gate it with a feature flag on the Rust side since that's the approach we already took elsewhere.
Right now it looks like freertos_rs_delete_task() is only used when spawning a task so maybe that's easy to do. We have had issues in the past where the linker still complains, and I'm not sure why - would be nice to learn more.
Add a feature in Cargo.toml
, is this appropriate?
Yes you've got the idea, I would prefer the logic to not be negative here (cfg(not(not_delete_task))
-> cfg(delete_task)
). This also means the feature is needed in the default list too.
Yes you've got the idea, I would prefer the logic to not be negative here (
cfg(not(not_delete_task))
->cfg(delete_task)
). This also means the feature is needed in the default list too.
Modified
Thanks!
Currently, if
INCLUDE_vTaskDelete
is set to 0, the compilation will fail.