# librertos **Repository Path**: Japhy/librertos ## Basic Information - **Project Name**: librertos - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-20 - **Last Updated**: 2024-11-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # [LibreRTOS](https://github.com/djboni/librertos) by [Djones A. Boni](https://twitter.com/djonesboni) LibreRTOS is a portable single-stack Real Time Operating System. Provides preemptive, cooperative and hybrid kernel modes. In hybrid mode only higher priority tasks can cause a preemption. All tasks share the same stack. This allows a large number of tasks to be created even on RAM constrained projects. Tasks must run to completion and also must hold its state into static memory. Interrupts that use LibreRTOS API must lock the scheduler at the beginning and unlock before returning. # Features * Single-stack * Preemptive, cooperative or hybrid kernel * Software timers (one-shot, periodic, no-period) * Semaphore * Queue (message queue) * Fifo (character queue) * Mutex (no priority inheritance mechanism) * Documentation is in the source files * Unit-tested [LibreRTOS Test](https://github.com/djboni/librertos_test) ## How to use LibreRTOS LibreRTOS uses only standard C and can be used in any architecture. User must provide two things: 1) A `projdefs.h` file, which defines LibreRTOS configurations and basic macros for interrupts and critical section management. For examples look at `port/projdefs_*.h` 2) A periodic tick interrupt. Below there is a simple initialization template. For a complete and working example take a look in our [AVR example](https://github.com/djboni/librertos/blob/master/doc/Example_AVR.md). ```c #include "LibreRTOS.h" void Timer_Interrupt(void) { OS_tick(); } int main(void) { /* Initialize LibreRTOS data structures. */ OS_init(); /* Start timer */ /* Initialize peripherals */ /* Create tasks */ /* Start scheduler. */ OS_start(); /* Run scheduler. */ for(;;) { OS_scheduler(); } } ``` ## Contributing to LibreRTOS If you have suggestions for improving LibreRTOS, please [open an issue or pull request on GitHub](https://github.com/djboni/librertos). # Licensing You can use LibreRTOS both for closed- and open-source projects. You are also free to keep changes to yourself. However we'll enjoy your improvements and suggestions. You are free to copy, modify, and distribute LibreRTOS with attribution under the terms of the [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). See the doc/LICENSE file for details. ## Important files [README.md](https://github.com/djboni/librertos/blob/master/README.md) Fast introduction (this file). [doc/LICENCE](https://github.com/djboni/librertos/blob/master/doc/LICENSE) Complete license text. [doc](https://github.com/djboni/librertos/tree/master/doc) Documentation and examples.