IamTheCarl / FreeRTOS-rust-carls-version

This is really a fork of https://github.com/lobaro/FreeRTOS-rust with some odd experiments of mine done to it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FreeRTOS-rust (Carl's version)

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.

How it works

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:

  1. A path to the FreeRTOS Sources
  2. A path to the app specific FreeRTOSConfig.h
  3. A relative path to the FreeRTOS port to be used, e.g. for ARM Cortex-M3 cores.
  4. Optional: Additional C code to be compiled

The freertos-rust dependency provides an interface to access all FreeRTOS functionality from your (embedded) Rust app.

License

This repository is using the MIT License. Some parts might state different licenses that need to be respected when used.

About

This is really a fork of https://github.com/lobaro/FreeRTOS-rust with some odd experiments of mine done to it.

License:MIT License


Languages

Language:C 92.7%Language:Assembly 5.9%Language:Rust 1.3%Language:Batchfile 0.1%Language:Python 0.1%Language:Shell 0.0%