ANTIRTOS v0.1.3 Released: Introducing Delayed Function Execution
We are excited to announce the release of ANTIRTOS v0.1.3, now available on GitHub. This release introduces a powerful new feature: delayed function execution. This enhancement allows developers to schedule functions to be executed after a specified delay, simplifying the management of timed operations in IoT and embedded systems.
Key Feature: Delayed Function Execution
The delayed function execution feature in ANTIRTOS v0.1.3 provides a straightforward mechanism to schedule functions to run after a certain delay, measured in ticks. This is particularly useful for time-dependent tasks in IoT and embedded applications.
Initializing the Delayed Function Queue
To utilize the delayed function feature, initialize a delayed function queue as follows:
del_fQ F5(8); // Create a delayed queue with a capacity of 8
Adding Functions to the Queue
You can add functions to the delayed queue, specifying the delay in ticks. Here’s how you can schedule two functions with different delays:
F5.push_delayed(your_func_1, 1000); // Schedule your_func_1() to be executed after 1000 ticks
F5.push_delayed(your_func_2, 2000); // Schedule your_func_2() to be executed after 2000 ticks
Executing the Delayed Functions
In your main loop or any other periodic loop, call the pull
method to execute the functions when their delay has elapsed. This function is highly efficient and can be executed quickly:
void loop() {
.......
F5.pull(); // Execute the scheduled functions
}
Tick Management
To manage the passage of ticks, call the tick
method in a timer or another periodic function. This keeps the queue aware of the timing and ensures that functions are executed at the correct time:
F5.tick(); // Update the queue with the passage of ticks
Getting Started with ANTIRTOS v0.1.3
To explore the new delayed function execution feature and other improvements, visit the
git clone https://github.com/WeSpeakEnglish/ANTIRTOS.git
cd antirtos
Developers are encouraged to try out the new features, contribute to the project, and provide feedback.
About ANTIRTOS
ANTIRTOS is an ultra-lightweight, universal C++ library designed for task management in IoT and embedded applications. It is coded in a single, small file of just 5KB, making it incredibly easy to integrate into your projects. ANTIRTOS aims to deliver a robust, secure, and efficient platform for task management. With its focus on modularity and scalability, ANTIRTOS is suitable for a variety of devices, from simple microcontrollers to complex embedded systems.