Copyright (c) 2016-2023 Djones A. Boni - MIT License
LibreRTOS is a portable Single-Stack Real-Time Operating System.
The main objective of LibreRTOS is to run in microcontrollers.
Features:
- Preemptive and cooperative kernel modes.
- Tasks and timers with priorities.
- Synchronization with queues, semaphores and mutexes.
Design goals:
- Portability:
- Strictly standard C (no compiler extensions), and
- Minimal assembly required (only 4 macros to manage interrupts).
- Real-Time: all operations that disable interrupts take constant time O(1).
- Single-Stack: all tasks share the same stack, allowing a large number of
tasks to be created on RAM constrained projects.
- The tasks must run to completion and must hold state in static memory.
- Static allocation: no use of malloc/free and such.
Notes:
- Interrupts that use LibreRTOS API must lock the scheduler at the beginning and unlock it before returning.
- Get the code:
- Clone this project using Git, or
- Download LibreRTOS as a zip file and extract it.
- Copy
src/librertos.c
andinclude/librertos.h
to your project - Add
#include "librertos.h"
to your source files and use LibreRTOS - Create a port file
librertos_port.h
for your hardware (see the examples) - Create a project file
librertos_proj.h
for your project (see the examples) - Initialize and use LibreRTOS in your project (see more in the documentation)