freertos-build 0.4.0

Utility lib for building & using FreeRTOS in rust projects inside the build.rs.
Documentation

freertos-build

Crates.io

Helper crate for building FreeRTOS applications with Cargo and Rust using a build.rs.

To build an embedded application with FreeRTOS please refer to repository.

The crate is published on freertos-build

Usage

cargo add --build freertos-build

Add this snippet to your apps build.rs:

fn main() {
    let mut b = freertos_build::Builder::new();

    // Path to FreeRTOS kernel or set ENV "FREERTOS_SRC" instead
    b.freertos("path/to/FreeRTOS-Kernel");
    b.freertos_config("src");       // Location of `FreeRTOSConfig.h`
    b.freertos_port("GCC/ARM_CM3"); // Port dir relativ to 'FreeRTOS-Kernel/portable'
    b.heap("heap_4.c");             // Set the heap_?.c allocator to use from
                                    // 'FreeRTOS-Kernel/portable/MemMang' (Default: heap_4.c)

    // b.get_cc().file("More.c");   // Optional additional C-Code to be compiled

    b.compile().unwrap_or_else(|e| { panic!("{}", e.to_string()) });
}