Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/BufferMessage/BufferMessage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* - The loop function reads the serial input and restarts the ESP32 when '.' is received.
*/

#include <Arduino.h>

#include "RTOScppBuffer.h"
#include "RTOScppTask.h"
using namespace RTOS::Buffers;
Expand Down
2 changes: 2 additions & 0 deletions examples/BufferStream/BufferStream.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* changes the trigger level of the buffer when '1' or '5' is received.
*/

#include <Arduino.h>

#include "RTOScppBuffer.h"
#include "RTOScppTask.h"
using namespace RTOS::Buffers;
Expand Down
2 changes: 2 additions & 0 deletions examples/Mutex/Mutex.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* - The loop function reads the serial input and restarts the ESP32 when '.' is received.
*/

#include <Arduino.h>

#include "RTOScppLock.h"
#include "RTOScppTask.h"
using namespace RTOS::Locks;
Expand Down
2 changes: 2 additions & 0 deletions examples/MutexRecursive/MutexRecursive.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* - The loop function reads the serial input and restarts the ESP32 when '.' is received.
*/

#include <Arduino.h>

#include "RTOScppLock.h"
#include "RTOScppTask.h"
using namespace RTOS::Locks;
Expand Down
2 changes: 2 additions & 0 deletions examples/Queue/Queue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* received.
*/

#include <Arduino.h>

#include "RTOScppQueue.h"
#include "RTOScppTask.h"
using namespace RTOS::Queues;
Expand Down
18 changes: 10 additions & 8 deletions examples/QueueSet/QueueSet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -29,6 +21,16 @@ using namespace RTOS::Tasks;
* received.
*/

#include <Arduino.h>

#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;

Expand Down
12 changes: 7 additions & 5 deletions examples/RingBufferByte/RingBufferByte.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,6 +16,13 @@ using namespace RTOS::Tasks;
* in the serial monitor that the message is received in chunks.
*/

#include <Arduino.h>

#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;
Expand Down
12 changes: 7 additions & 5 deletions examples/RingBufferNoSplit/RingBufferNoSplit.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,6 +15,13 @@ using namespace RTOS::Tasks;
* received.
*/

#include <Arduino.h>

#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
Expand Down
12 changes: 7 additions & 5 deletions examples/RingBufferSplit/RingBufferSplit.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +18,13 @@ using namespace RTOS::Tasks;
* consumer task will concatenate the two parts and print the complete message.
*/

#include <Arduino.h>

#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
Expand Down
2 changes: 2 additions & 0 deletions examples/SemaphoreBinary/SemaphoreBinary.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* signals the event to the consumer task when 's' is received.
*/

#include <Arduino.h>

#include "RTOScppLock.h"
#include "RTOScppTask.h"
using namespace RTOS::Locks;
Expand Down
2 changes: 2 additions & 0 deletions examples/SemaphoreCounting/SemaphoreCounting.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* signals the event to the consumer task when 's' is received.
*/

#include <Arduino.h>

#include "RTOScppLock.h"
#include "RTOScppTask.h"
using namespace RTOS::Locks;
Expand Down
2 changes: 2 additions & 0 deletions examples/Task/Task.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* - Task 2 waits for a notification for 5 seconds and increments the 'b' parameter.
*/

#include <Arduino.h>

#include "RTOScppTask.h"
using namespace RTOS::Tasks;

Expand Down
2 changes: 2 additions & 0 deletions examples/Timer/Timer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* - A message is printed if the print timer expired and restarts it.
*/

#include <Arduino.h>

#include "RTOScppTimer.h"
using namespace RTOS::Timers;

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RTOScppESP32",
"version": "1.1.0",
"version": "1.1.1",
"authors": {
"name": "Maximiliano Ramirez",
"email": "maximiliano.ramirezbravo@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=RTOScppESP32
version=1.1.0
version=1.1.1
author=Maximiliano Ramirez <maximiliano.ramirezbravo@gmail.com>
maintainer=Maximiliano Ramirez <maximiliano.ramirezbravo@gmail.com>
sentence=FreeRTOS abstraction layer for ESP32 with C++ interface.
Expand Down
26 changes: 13 additions & 13 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/RTOScppBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#pragma once

#include <Arduino.h>

#include <freertos/FreeRTOS.h>
#include <freertos/message_buffer.h>
#include <freertos/stream_buffer.h>

Expand Down
3 changes: 1 addition & 2 deletions src/RTOScppLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#pragma once

#include <Arduino.h>

#include <freertos/FreeRTOS.h>
#include <freertos/queue.h>
#include <freertos/semphr.h>

Expand Down
3 changes: 1 addition & 2 deletions src/RTOScppQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#pragma once

#include <Arduino.h>

#include <freertos/FreeRTOS.h>
#include <freertos/queue.h>

namespace RTOS::Queues {
Expand Down
2 changes: 0 additions & 2 deletions src/RTOScppQueueSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#pragma once

#include <Arduino.h>

#include "RTOScppLock.h"
#include "RTOScppQueue.h"
#include "RTOScppRingBuffer.h"
Expand Down
2 changes: 0 additions & 2 deletions src/RTOScppRingBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#pragma once

#include <Arduino.h>

#include <freertos/ringbuf.h>

namespace RTOS::RingBuffers {
Expand Down
3 changes: 1 addition & 2 deletions src/RTOScppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#pragma once

#include <Arduino.h>

#include <freertos/FreeRTOS.h>
#include <freertos/task.h>

namespace RTOS::Tasks {
Expand Down
3 changes: 1 addition & 2 deletions src/RTOScppTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#pragma once

#include <Arduino.h>

#include <freertos/FreeRTOS.h>
#include <freertos/timers.h>

namespace RTOS::Timers {
Expand Down
1 change: 1 addition & 0 deletions test/test_buffers/test_buffers.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppBuffer.h"
Expand Down
3 changes: 1 addition & 2 deletions test/test_locks/test_locks.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppLock.h"

#include <memory>

using namespace RTOS::Locks;

/* -------------------------------------------- Locks ------------------------------------------- */
Expand Down
1 change: 1 addition & 0 deletions test/test_queues/test_queues.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppQueue.h"
Expand Down
1 change: 1 addition & 0 deletions test/test_queuesets/test_queuesets.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppQueueSet.h"
Expand Down
1 change: 1 addition & 0 deletions test/test_ringbuffers/test_ringbuffers.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppRingBuffer.h"
Expand Down
1 change: 1 addition & 0 deletions test/test_tasks/test_tasks.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppTask.h"
Expand Down
1 change: 1 addition & 0 deletions test/test_timers/test_timers.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Arduino.h>
#include <unity.h>

#include "RTOScppTimer.h"
Expand Down