This project is based on code from freertos-rust, which is based on freertos.rs and some additions to simplify the usage of FreeRTOS in embedded applications written in Rust.
This is a work in progress but it's planned to eventually be significantly different from the original freertos-rust. Rather than wrapping C functions in structs and calling it a day, this library intends to make FreeRTOS feel like it was designed to be used with Rust.
Planned changes:
- Safe sharing of queues and other data structures between tasks.
- Safe deferred interrupts
- Access to raw handles for when this API is getting in your way (let me know when that happens)
- Have FreeRTOS use the Rust global heap, rather than Rust use the FreeRTOS heap. (unsure if possible)
Complete changes:
- Tasks are given a handle to themselves
- Compiler enforced prevention of calling non-ISR safe functions from an ISR
- Convenient (and reasonably safe) handoff of assets to ISRs.
The freertos-cargo-build
build-dependency compiles the FreeRTOS code from its original "C" sources files into an
archive to be linked against your Rust app. Internally it uses the cc crate and some meta
info provided by your apps build.rs
:
- A path to the FreeRTOS
Sources
- A path to the app specific
FreeRTOSConfig.h
- A relative path to the
FreeRTOS port
to be used, e.g. for ARM Cortex-M3 cores. - Optional: Additional C code to be compiled
The freertos-rust
dependency provides an interface to access all FreeRTOS functionality from your (embedded)
Rust app.
This repository is using the MIT License. Some parts might state different licenses that need to be respected when used.
- The Linux port is licensed under GPLv2