Skip to content

Releases: Moaaz-i/MicroTaskX

Release v4.0.0

Choose a tag to compare

@github-actions github-actions released this 28 Jun 06:26
09b3dd8

Automated release for version 4.0.0

MicroTaskX v3.1.1

Choose a tag to compare

@Moaaz-i Moaaz-i released this 23 Jun 14:32

What's Changed

📝 Metadata & Documentation

  • Updated library.properties and library.json descriptions to fully reflect all features introduced in v3.1.0
  • Expanded keywords list in library.json for better discoverability on PlatformIO and Arduino registries
  • Fixed README usage example formatting

🔑 Keywords Added

kalman-filter, software-pwm, rotary-encoder, watchdog, isr-queuing, coroutines, mutexes, signals, crc8, battery-monitor

ℹ️ No code changes

This is a metadata-only release. All functional changes were shipped in v3.1.0.

v3.1.0 - Advanced Control Utilities & Flicker-Free Display Optimizations

Choose a tag to compare

@Moaaz-i Moaaz-i released this 23 Jun 05:40

🚀 MicroTaskX v3.1.0 — Advanced Control Utilities & Display Optimizations
We are excited to announce the release of MicroTaskX v3.1.0! This version introduces a major overhaul to MTXUtils, transforming it from basic utility functions into a robust, standalone toolset for embedded systems, advanced robotics, automation, and high-performance UI rendering.
This update maintains complete separation of concerns, keeping MTXUtils completely decoupled from the core MicroTaskXKernel scheduler.
🌟 What's New in v3.1.0

  1. 🎮 Advanced Control Systems
    Anti-Windup PID Controller (computePID): Implement closed-loop control for motors, heaters, or balancing robots safely with integrated integral windup prevention.
    Hysteresis Logic (applyHysteresis): Protect physical relays and hardware components from rapid oscillation near threshold limits.
  2. ⚡ High-Speed LCD Drawing & Visual Aesthetics
    Flicker-Free Screen Updates (updateScreenSmart): A template-driven differential buffer update that modifies only changed characters on LiquidCrystal / I2C displays, drastically reducing drawing overhead and eliminating annoying screen flashes.
    Non-Blocking Typewriter Effect (printTypewriter): Smooth, cinematic text scrolling without blocking the main loop or tasks.
    Centered Output Calculator (getCenterOffset): Automatic string centering based on your display's columns.
    Visual Progress Bar Generator (getProgressBarString): Instantly render text-based progress bars (e.g., [===== ]).
  3. 📊 Signal Filtering & Data Buffering
    True Moving Average Filter (movingAverage): A sliding-window filter to suppress extreme analog noise.
    Generic Circular Queue Class (MTXCircularQueue): High-speed, lock-free ring buffer template for smooth hardware communication (e.g., Serial/UART streams).
    Signal Edge Detection (isRisingEdge/isFallingEdge): Low-overhead state change monitoring.
  4. 🧮 Data Integrity & System Metrics
    Dallas/Maxim CRC8 Checksum (computeCRC8): Verify data packets across wireless modules or storage without standard library overhead.
    Battery Level Calculator (calculateBatteryPercentage): Hardware-aware voltage scaling using analog pins and resistor dividers.
    Time & Hex Formatters: Built-in formatMillisToTime (HH:MM:SS) and byte-to-hex utility conversions.
    🛠 File Changes & Structural Updates
    MTXUtils.h: Upgraded with template structures, MTXButton encapsulation fix, and advanced hardware management methods.
    MTXUtils.cpp: Implementation of standard mathematical and logic controllers.
    library.json & library.properties: Bumped version metadata to 3.1.0 and appended new control/timing keywords.
    💻 Quick Usage Example
#include <MicroTaskX.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

char currentFrame[2][17] = {"                ", "                "};
char memoryFrame[2][17]  = {"                ", "                "};
MTXPID speedPID = { 2.5, 0.5, 0.1, 0, 0, 0, 255 }; 

void setup() {
  lcd.init();
}

void loop() {
  // 1. Smooth PID calculation
  float motorPWM = MTXUtils::computePID(100.0, readEncoder(), speedPID, 0.01);
  
  // 2. Flicker-free UI Rendering
  sprintf(currentFrame[0], "PWM Out: %03d    ", (int)motorPWM);
  MTXUtils::getProgressBarString(16, (motorPWM/255)*100, currentFrame[1]);
  
  MTXUtils::updateScreenSmart<16, 2>(lcd, currentFrame, memoryFrame);
}

👥 Contributors
Special thanks to Moaaz Yahia Shrif for maintaining and evolving the framework architectures.

v3.0.0 - Modular Architecture & Advanced Scheduling

Choose a tag to compare

@Moaaz-i Moaaz-i released this 23 Jun 03:42

What's New in v3.0.0 🎉

Welcome to the biggest upgrade of MicroTaskX yet! This release transitions the framework into a fully modular architecture, separating the core scheduling kernel from external peripheral utilities to drastically reduce memory consumption.

🚀 Core Upgrades & New Features

  • Compile-Time Templates: The scheduler is now a Template Class, allowing developers to define custom maximum task bounds (MicroTaskXKernel<MAX_TASKS>) seamlessly.
  • Runtime Task Management: Added built-in APIs to mutate tasks dynamically (pauseTask(), resumeTask(), setInterval()).
  • One-Shot Task Execution: Added addOneShotTask() to schedule non-recurring background functions safely.
  • Multi-Sensor Independence: Rewrote hardware smoothing utilities to utilize reference parameters, resolving cross-talk bugs when reading multiple analog inputs.
  • True ESP32 Low-Power Support: Upgraded the SmartSleep mechanism to activate esp_light_sleep_start() calculation-mapped to the precise delay of incoming tasks.

⚠️ Breaking Changes

  • MTX_END() must now be written as MTX_END (without parenthesis) due to preprocessor macro optimizations.
  • smoothRead and smoothReadFast now require passing a reference to a dedicated logging variable to avoid global data interference.

Full Changelog: 2.6.0...3.0.0

MicroTaskX v2.6.0 — Performance & Stability Upgrade

Choose a tag to compare

@Moaaz-i Moaaz-i released this 22 Jun 18:21

MicroTaskX v2.6.0 — Performance & Stability Upgrade 🚀

This release introduces a fully optimized multitasking engine, new example projects,
improved macro timers, and enhanced CPU profiling accuracy.

✨ New Features

  • New example set (Blink, MultiTimers, Scheduler, CPU Monitor, Smart Lighting)
  • Improved task scheduler with better priority handling
  • Faster analog smoothing (EMA)
  • More stable macro timers (MTX_EVERY)
  • Cleaner API with MicroTaskX.h include

🛠 Internal Improvements

  • Reduced RAM usage
  • Faster task dispatch loop
  • Improved idle-window calibration
  • Better AVR/ESP32 compatibility

📦 Compatibility

  • Arduino AVR
  • Arduino SAMD
  • ESP32
  • ESP8266
  • All architectures supported by Arduino

No breaking changes.

MicroTaskX v2.5.2 — High‑Efficiency Edition

Choose a tag to compare

@Moaaz-i Moaaz-i released this 22 Jun 17:57

MicroTaskX v2.5.2 — High‑Efficiency Edition 🚀

This release introduces major performance improvements, a priority-based task scheduler,
independent macro timers, real-time CPU load profiling, and faster analog smoothing.

✨ New Features

  • Priority-based task scheduler (LOW / MEDIUM / HIGH)
  • Independent non-blocking macro timers (MTX_EVERY)
  • Real-time CPU usage profiling
  • Turbo ADC optimization for AVR
  • Zero-overhead EMA analog smoothing
  • Hardware debounced button handling
  • Fast direct port toggling

🛠 Internal Improvements

  • Reduced RAM footprint
  • Faster task dispatching
  • Improved idle-window calibration
  • Better cross-platform stability

📦 Compatibility

  • Arduino AVR
  • Arduino SAMD
  • ESP32
  • ESP8266
  • All architectures supported by Arduino

No breaking changes.

Correcting some errors in the latest version

Choose a tag to compare

@Moaaz-i Moaaz-i released this 22 Jun 14:14
2.5.1

fix

v2.5.0 - Optimized Memory & High-Efficiency Edition

Choose a tag to compare

@Moaaz-i Moaaz-i released this 22 Jun 13:57

🚀 UMOZ Library v2.5.0

We are excited to announce the release of v2.5.0 of the UMOZ library! This version is focused on ultra-lightweight multitasking, enhanced power saving, and high-efficiency resource management for Arduino microcontrollers.


✨ What's New & Key Features

1. Priority-Based Task Scheduler

  • Introducing a lightweight cooperative scheduler via addTask().
  • Supports task prioritization (UMOZ_LOW, UMOZ_MEDIUM, UMOZ_HIGH). The scheduler automatically resolves timing conflicts by executing higher-priority tasks first.

2. Smart Sleep Mode (Power Saving)

  • When enabled via enableSmartSleep(true), the library calculates the time left until the next scheduled task.
  • If the idle period is greater than 5ms, it automatically puts AVR microcontrollers into SLEEP_MODE_IDLE, significantly reducing current consumption.

3. Real-Time CPU Usage Monitor

  • Track system load effortlessly using getCPUUsage().
  • It uses an optimized idle-counting mechanism (benchTick()) to compute and report precise CPU utilization percentages every second.

4. Expressive Syntax Macros

  • Say goodbye to boilerplate code! Streamline your application layout with innovative macros:
    • UMOZ_START(), UMOZ_RUN(), and UMOZ_END to wrap your setup and execution flow seamlessly.
    • UMOZ_EVERY_MS(ms) and UMOZ_EVERY_HZ(hz) for inline, non-blocking timed executions without manually declaring states.

5. Hardware-Level Fast I/O & Math

  • toggleFast<PIN>(): Leverages direct port manipulation registers (portInputRegister) for blazing-fast pin flipping on AVR architecture.
  • smoothReadFast<ANALOG_PIN>(): A high-efficiency analog noise filter utilizing bitwise shift operations (>> 3) instead of resource-heavy division.

🛠️ Technical Specifications

  • Design Pattern: Implemented using the Singleton Pattern (getInstance()) to prevent multiple instances from wasting precious SRAM. Access it globally via the tool alias.
  • Memory Protection: Deleted Copy Constructor and Assignment Operator to completely safeguard against accidental memory duplication.
  • Debounce Engine: Built-in hardware switch debouncing (isButtonPressed) with a solid 50ms stable window filter.
  • Task Boundary: Defaults to a static allocation of up to 5 concurrent tasks (UMOZ_MAX_TASKS) to guarantee memory predictability.

📦 Quick Start Example

#include <UMOZ.h>

void blinkTask() {
    tool.toggle(LED_BUILTIN);
}

UMOZ_START()
  tool.addTask(blinkTask, 500, UMOZ_HIGH);
  tool.enableSmartSleep(true);
UMOZ_RUN()
  // Your main loop code can go here
UMOZ_END

UMOZ v2.0.0 - Cross-Platform Core & Smart Low-Power Sleep Architecture

Choose a tag to compare

@Moaaz-i Moaaz-i released this 21 Jun 03:12

What's New in v2.0.0 🚀

We are thrilled to announce v2.0.0, a major architectural milestone that transforms UMOZ into a Cross-Platform Micro-Framework and introduces intelligent hardware power management!

✨ Key Features & Enhancements:

  • Cross-Platform Core: The internal hardware abstractions have been decoupled. UMOZ now dynamically adapts its hardware register optimizations (like High-Speed ADC and Direct Port Toggling) based on the target architecture, paving the way for seamless deployment on AVR and modern chips like ESP32.
  • Smart Sleep Mode: Integrated a low-power enterLowPowerSleep() routine using hardware SLEEP_MODE_IDLE. When the processor is idle and evaluates that the next scheduled task is more than 5ms away, it safely puts the CPU to sleep, drastically cutting down power/battery consumption without losing clock accuracy.
  • Deterministic Diagnostics: Refined the internal getCPUUsage() bounds to guarantee robust execution profiles across both low-frequency and high-frequency development boards.

📋 Activation Example:

UMOZ_START()
  Serial.begin(9600);
  tool.begin(13);
  
  // Enable the new Smart Sleep architecture to save battery during idle cycles
  tool.enableSmartSleep(true);
  
  tool.addTask(myTask, 500);
UMOZ_RUN()
UMOZ_END

UMOZ v1.2.0 - Static Priority Task Scheduler & Performance Calibration

Choose a tag to compare

@Moaaz-i Moaaz-i released this 21 Jun 02:39

What's New in v1.2.0 🚀

We are proud to introduce v1.2.0 of the UMOZ framework. This release shifts the multitasking engine from a simple sequential dispatcher to a Priority-Aware Scheduler, allowing critical micro-tasks to preempt or run before low-priority operations when execution windows overlap.

✨ Major Enhancements:

  • Priority Scheduling Engine: Integrated UMOZPriority enum (UMOZ_LOW, UMOZ_MEDIUM, UMOZ_HIGH) into the static task structure. The runtime loop now evaluates all due tasks and guarantees that the highest priority task runs first.
  • Deterministic Execution: Eliminated latency jitter for critical operations (like sensor safety polling) by giving them explicit higher execution weights.
  • Typo Fixes & Safety Patches: Resolved compiler boundary edge-cases by enforcing constrain() bounds inside the live getCPUUsage() diagnostics function.
  • Backward Compatibility: Kept the standard addTask method signature fully backward-compatible by injecting UMOZ_MEDIUM as a default parameter level.

📋 Usage Preview:

// Schedule a critical safety task with HIGH priority
tool.addTask(criticalTask, 100, UMOZ_HIGH);

// Schedule a regular telemetry task with LOW priority
tool.addTask(telemetryTask, 100, UMOZ_LOW);

🛠️ Installation & Upgrading
Update your local installation by pulling the latest changes from the main branch or downloading this release zip file into your Arduino libraries/ directory.