From 23e3975bdc9e8c00a50f1f6e2b995afe3a78b01a Mon Sep 17 00:00:00 2001 From: alkonosst Date: Sun, 26 Apr 2026 23:16:27 -0400 Subject: [PATCH] fix: Remove Arduino header from source files --- examples/BufferMessage/BufferMessage.ino | 2 ++ examples/BufferStream/BufferStream.ino | 2 ++ examples/Mutex/Mutex.ino | 2 ++ examples/MutexRecursive/MutexRecursive.ino | 2 ++ examples/Queue/Queue.ino | 2 ++ examples/QueueSet/QueueSet.ino | 18 +++++++------ examples/RingBufferByte/RingBufferByte.ino | 12 +++++---- .../RingBufferNoSplit/RingBufferNoSplit.ino | 12 +++++---- examples/RingBufferSplit/RingBufferSplit.ino | 12 +++++---- examples/SemaphoreBinary/SemaphoreBinary.ino | 2 ++ .../SemaphoreCounting/SemaphoreCounting.ino | 2 ++ examples/Task/Task.ino | 2 ++ examples/Timer/Timer.ino | 2 ++ library.json | 2 +- library.properties | 2 +- platformio.ini | 26 +++++++++---------- src/RTOScppBuffer.h | 3 +-- src/RTOScppLock.h | 3 +-- src/RTOScppQueue.h | 3 +-- src/RTOScppQueueSet.h | 2 -- src/RTOScppRingBuffer.h | 2 -- src/RTOScppTask.h | 3 +-- src/RTOScppTimer.h | 3 +-- test/test_buffers/test_buffers.cpp | 1 + test/test_locks/test_locks.cpp | 3 +-- test/test_queues/test_queues.cpp | 1 + test/test_queuesets/test_queuesets.cpp | 1 + test/test_ringbuffers/test_ringbuffers.cpp | 1 + test/test_tasks/test_tasks.cpp | 1 + test/test_timers/test_timers.cpp | 1 + 30 files changed, 76 insertions(+), 54 deletions(-) diff --git a/examples/BufferMessage/BufferMessage.ino b/examples/BufferMessage/BufferMessage.ino index 2f8aff3..d6f73e4 100644 --- a/examples/BufferMessage/BufferMessage.ino +++ b/examples/BufferMessage/BufferMessage.ino @@ -15,6 +15,8 @@ * - The loop function reads the serial input and restarts the ESP32 when '.' is received. */ +#include + #include "RTOScppBuffer.h" #include "RTOScppTask.h" using namespace RTOS::Buffers; diff --git a/examples/BufferStream/BufferStream.ino b/examples/BufferStream/BufferStream.ino index dd1b3ca..cd0e468 100644 --- a/examples/BufferStream/BufferStream.ino +++ b/examples/BufferStream/BufferStream.ino @@ -15,6 +15,8 @@ * changes the trigger level of the buffer when '1' or '5' is received. */ +#include + #include "RTOScppBuffer.h" #include "RTOScppTask.h" using namespace RTOS::Buffers; diff --git a/examples/Mutex/Mutex.ino b/examples/Mutex/Mutex.ino index 685b3eb..67ee385 100644 --- a/examples/Mutex/Mutex.ino +++ b/examples/Mutex/Mutex.ino @@ -14,6 +14,8 @@ * - The loop function reads the serial input and restarts the ESP32 when '.' is received. */ +#include + #include "RTOScppLock.h" #include "RTOScppTask.h" using namespace RTOS::Locks; diff --git a/examples/MutexRecursive/MutexRecursive.ino b/examples/MutexRecursive/MutexRecursive.ino index f279f53..f80f666 100644 --- a/examples/MutexRecursive/MutexRecursive.ino +++ b/examples/MutexRecursive/MutexRecursive.ino @@ -17,6 +17,8 @@ * - The loop function reads the serial input and restarts the ESP32 when '.' is received. */ +#include + #include "RTOScppLock.h" #include "RTOScppTask.h" using namespace RTOS::Locks; diff --git a/examples/Queue/Queue.ino b/examples/Queue/Queue.ino index b392fbe..df39137 100644 --- a/examples/Queue/Queue.ino +++ b/examples/Queue/Queue.ino @@ -15,6 +15,8 @@ * received. */ +#include + #include "RTOScppQueue.h" #include "RTOScppTask.h" using namespace RTOS::Queues; diff --git a/examples/QueueSet/QueueSet.ino b/examples/QueueSet/QueueSet.ino index 9c189b7..c7c2fe9 100644 --- a/examples/QueueSet/QueueSet.ino +++ b/examples/QueueSet/QueueSet.ino @@ -4,14 +4,6 @@ * SPDX-License-Identifier: MIT */ -#include "RTOScppQueueSet.h" -#include "RTOScppTask.h" -using namespace RTOS::QueueSets; -using namespace RTOS::Locks; -using namespace RTOS::Queues; -using namespace RTOS::RingBuffers; -using namespace RTOS::Tasks; - /** Explanation of the example: * - This example shows how to use a queue set to receive events from a semaphore, a queue, and a * ring buffer. @@ -29,6 +21,16 @@ using namespace RTOS::Tasks; * received. */ +#include + +#include "RTOScppQueueSet.h" +#include "RTOScppTask.h" +using namespace RTOS::QueueSets; +using namespace RTOS::Locks; +using namespace RTOS::Queues; +using namespace RTOS::RingBuffers; +using namespace RTOS::Tasks; + // Binary Semaphore SemBinaryStatic sem; diff --git a/examples/RingBufferByte/RingBufferByte.ino b/examples/RingBufferByte/RingBufferByte.ino index 153d0a3..89edfd7 100644 --- a/examples/RingBufferByte/RingBufferByte.ino +++ b/examples/RingBufferByte/RingBufferByte.ino @@ -4,11 +4,6 @@ * SPDX-License-Identifier: MIT */ -#include "RTOScppRingBuffer.h" -#include "RTOScppTask.h" -using namespace RTOS::RingBuffers; -using namespace RTOS::Tasks; - /** Explanation of the example: * - This example shows how to use a byte ring buffer to send data between two tasks. * - Two tasks are created to illustrate the use of the byte ring buffer. The producer task sends @@ -21,6 +16,13 @@ using namespace RTOS::Tasks; * in the serial monitor that the message is received in chunks. */ +#include + +#include "RTOScppRingBuffer.h" +#include "RTOScppTask.h" +using namespace RTOS::RingBuffers; +using namespace RTOS::Tasks; + // Byte Ring Buffer with a size of 32 bytes // - The max item size is 32 bytes and the buffer is aligned to the next 4 bytes multiple RingBufferByteStatic<32> buffer; diff --git a/examples/RingBufferNoSplit/RingBufferNoSplit.ino b/examples/RingBufferNoSplit/RingBufferNoSplit.ino index d027fb4..ac076ff 100644 --- a/examples/RingBufferNoSplit/RingBufferNoSplit.ino +++ b/examples/RingBufferNoSplit/RingBufferNoSplit.ino @@ -4,11 +4,6 @@ * SPDX-License-Identifier: MIT */ -#include "RTOScppRingBuffer.h" -#include "RTOScppTask.h" -using namespace RTOS::RingBuffers; -using namespace RTOS::Tasks; - /** Explanation of the example: * - This example shows how to use a no-split ring buffer to send data between two tasks. * - Two tasks are created to illustrate the use of the no-split ring buffer. The producer task @@ -20,6 +15,13 @@ using namespace RTOS::Tasks; * received. */ +#include + +#include "RTOScppRingBuffer.h" +#include "RTOScppTask.h" +using namespace RTOS::RingBuffers; +using namespace RTOS::Tasks; + // No-split Ring Buffer with a size of 32 bytes // - The max item size is ((bufferSize / 2) - headerSize), headerSize being 8 bytes // - In this case, the item is (32 / 2) - 8 = 8 bytes diff --git a/examples/RingBufferSplit/RingBufferSplit.ino b/examples/RingBufferSplit/RingBufferSplit.ino index b11c96e..7f72ed2 100644 --- a/examples/RingBufferSplit/RingBufferSplit.ino +++ b/examples/RingBufferSplit/RingBufferSplit.ino @@ -4,11 +4,6 @@ * SPDX-License-Identifier: MIT */ -#include "RTOScppRingBuffer.h" -#include "RTOScppTask.h" -using namespace RTOS::RingBuffers; -using namespace RTOS::Tasks; - /** Explanation of the example: * - This example shows how to use a split ring buffer to send data between two tasks. * - Two tasks are created to illustrate the use of the split ring buffer. The producer task sends @@ -23,6 +18,13 @@ using namespace RTOS::Tasks; * consumer task will concatenate the two parts and print the complete message. */ +#include + +#include "RTOScppRingBuffer.h" +#include "RTOScppTask.h" +using namespace RTOS::RingBuffers; +using namespace RTOS::Tasks; + // Split Ring Buffer with a size of 32 bytes // - The max item size is (bufferSize / 2) // - In this case, the max item size is (32 / 2) = 16 bytes diff --git a/examples/SemaphoreBinary/SemaphoreBinary.ino b/examples/SemaphoreBinary/SemaphoreBinary.ino index 90517a0..3cc28fa 100644 --- a/examples/SemaphoreBinary/SemaphoreBinary.ino +++ b/examples/SemaphoreBinary/SemaphoreBinary.ino @@ -14,6 +14,8 @@ * signals the event to the consumer task when 's' is received. */ +#include + #include "RTOScppLock.h" #include "RTOScppTask.h" using namespace RTOS::Locks; diff --git a/examples/SemaphoreCounting/SemaphoreCounting.ino b/examples/SemaphoreCounting/SemaphoreCounting.ino index f9cd9b9..61cc065 100644 --- a/examples/SemaphoreCounting/SemaphoreCounting.ino +++ b/examples/SemaphoreCounting/SemaphoreCounting.ino @@ -16,6 +16,8 @@ * signals the event to the consumer task when 's' is received. */ +#include + #include "RTOScppLock.h" #include "RTOScppTask.h" using namespace RTOS::Locks; diff --git a/examples/Task/Task.ino b/examples/Task/Task.ino index c96bdd3..f20f948 100644 --- a/examples/Task/Task.ino +++ b/examples/Task/Task.ino @@ -21,6 +21,8 @@ * - Task 2 waits for a notification for 5 seconds and increments the 'b' parameter. */ +#include + #include "RTOScppTask.h" using namespace RTOS::Tasks; diff --git a/examples/Timer/Timer.ino b/examples/Timer/Timer.ino index 291b757..eb965b4 100644 --- a/examples/Timer/Timer.ino +++ b/examples/Timer/Timer.ino @@ -18,6 +18,8 @@ * - A message is printed if the print timer expired and restarts it. */ +#include + #include "RTOScppTimer.h" using namespace RTOS::Timers; diff --git a/library.json b/library.json index 63ba2e7..c6c6284 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "RTOScppESP32", - "version": "1.1.0", + "version": "1.1.1", "authors": { "name": "Maximiliano Ramirez", "email": "maximiliano.ramirezbravo@gmail.com" diff --git a/library.properties b/library.properties index e9b90ef..9dcfee2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=RTOScppESP32 -version=1.1.0 +version=1.1.1 author=Maximiliano Ramirez maintainer=Maximiliano Ramirez sentence=FreeRTOS abstraction layer for ESP32 with C++ interface. diff --git a/platformio.ini b/platformio.ini index 27ed666..e948a3b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,20 +9,20 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -; lib_dir = . -; src_dir = examples/Task -; src_dir = examples/Timer +lib_dir = . +; src_dir = examples/BufferMessage +; src_dir = examples/BufferStream ; src_dir = examples/Mutex ; src_dir = examples/MutexRecursive -; src_dir = examples/SemaphoreBinary -; src_dir = examples/SemaphoreCounting ; src_dir = examples/Queue -; src_dir = examples/BufferStream -; src_dir = examples/BufferMessage +; src_dir = examples/QueueSet +; src_dir = examples/RingBufferByte ; src_dir = examples/RingBufferNoSplit ; src_dir = examples/RingBufferSplit -; src_dir = examples/RingBufferByte -; src_dir = examples/QueueSet +; src_dir = examples/SemaphoreBinary +; src_dir = examples/SemaphoreCounting +src_dir = examples/Task +; src_dir = examples/Timer [env:esp32-s3] platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip @@ -31,10 +31,10 @@ framework = arduino ; Tests ; test_ignore = - ; test_buffers - ; test_locks - ; test_queues - ; test_queuesets +; test_buffers +; test_locks +; test_queues +; test_queuesets ; test_ringbuffers ; test_tasks ; test_timers diff --git a/src/RTOScppBuffer.h b/src/RTOScppBuffer.h index 4f29fbf..7b36335 100644 --- a/src/RTOScppBuffer.h +++ b/src/RTOScppBuffer.h @@ -6,8 +6,7 @@ #pragma once -#include - +#include #include #include diff --git a/src/RTOScppLock.h b/src/RTOScppLock.h index ac08304..4a6e823 100644 --- a/src/RTOScppLock.h +++ b/src/RTOScppLock.h @@ -6,8 +6,7 @@ #pragma once -#include - +#include #include #include diff --git a/src/RTOScppQueue.h b/src/RTOScppQueue.h index 469f63e..27694aa 100644 --- a/src/RTOScppQueue.h +++ b/src/RTOScppQueue.h @@ -6,8 +6,7 @@ #pragma once -#include - +#include #include namespace RTOS::Queues { diff --git a/src/RTOScppQueueSet.h b/src/RTOScppQueueSet.h index a0b9d08..748da22 100644 --- a/src/RTOScppQueueSet.h +++ b/src/RTOScppQueueSet.h @@ -6,8 +6,6 @@ #pragma once -#include - #include "RTOScppLock.h" #include "RTOScppQueue.h" #include "RTOScppRingBuffer.h" diff --git a/src/RTOScppRingBuffer.h b/src/RTOScppRingBuffer.h index a16bf55..640a475 100644 --- a/src/RTOScppRingBuffer.h +++ b/src/RTOScppRingBuffer.h @@ -6,8 +6,6 @@ #pragma once -#include - #include namespace RTOS::RingBuffers { diff --git a/src/RTOScppTask.h b/src/RTOScppTask.h index ba0ac64..d3024df 100644 --- a/src/RTOScppTask.h +++ b/src/RTOScppTask.h @@ -6,8 +6,7 @@ #pragma once -#include - +#include #include namespace RTOS::Tasks { diff --git a/src/RTOScppTimer.h b/src/RTOScppTimer.h index 5644901..ef87aec 100644 --- a/src/RTOScppTimer.h +++ b/src/RTOScppTimer.h @@ -6,8 +6,7 @@ #pragma once -#include - +#include #include namespace RTOS::Timers { diff --git a/test/test_buffers/test_buffers.cpp b/test/test_buffers/test_buffers.cpp index d75d77b..5218c79 100644 --- a/test/test_buffers/test_buffers.cpp +++ b/test/test_buffers/test_buffers.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppBuffer.h" diff --git a/test/test_locks/test_locks.cpp b/test/test_locks/test_locks.cpp index 88441dd..edd8f62 100644 --- a/test/test_locks/test_locks.cpp +++ b/test/test_locks/test_locks.cpp @@ -1,9 +1,8 @@ +#include #include #include "RTOScppLock.h" -#include - using namespace RTOS::Locks; /* -------------------------------------------- Locks ------------------------------------------- */ diff --git a/test/test_queues/test_queues.cpp b/test/test_queues/test_queues.cpp index 7781e3f..6c76e04 100644 --- a/test/test_queues/test_queues.cpp +++ b/test/test_queues/test_queues.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppQueue.h" diff --git a/test/test_queuesets/test_queuesets.cpp b/test/test_queuesets/test_queuesets.cpp index cb40b09..fef50f3 100644 --- a/test/test_queuesets/test_queuesets.cpp +++ b/test/test_queuesets/test_queuesets.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppQueueSet.h" diff --git a/test/test_ringbuffers/test_ringbuffers.cpp b/test/test_ringbuffers/test_ringbuffers.cpp index 86ac807..0c6b350 100644 --- a/test/test_ringbuffers/test_ringbuffers.cpp +++ b/test/test_ringbuffers/test_ringbuffers.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppRingBuffer.h" diff --git a/test/test_tasks/test_tasks.cpp b/test/test_tasks/test_tasks.cpp index 07feca7..491a4c9 100644 --- a/test/test_tasks/test_tasks.cpp +++ b/test/test_tasks/test_tasks.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppTask.h" diff --git a/test/test_timers/test_timers.cpp b/test/test_timers/test_timers.cpp index 2618024..d95b880 100644 --- a/test/test_timers/test_timers.cpp +++ b/test/test_timers/test_timers.cpp @@ -1,3 +1,4 @@ +#include #include #include "RTOScppTimer.h"