Skip to content

Commit

Permalink
Merge branch 'release/v0.5' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jonenz committed Feb 13, 2023
2 parents 6e30c74 + cf91c94 commit 4bda404
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 188 deletions.
6 changes: 5 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ Checks: 'cert-*,
-cert-err58-cpp,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-virtual-class-destructor,
-google-runtime-references,
-hicpp-avoid-c-arrays,
-hicpp-member-init,
-hicpp-named-parameter,
-hicpp-no-array-decay,
-hicpp-no-assembler,
-readability-named-parameter,
'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
Expand Down Expand Up @@ -152,7 +156,7 @@ CheckOptions:
- key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
value: ''
- key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
value: '0'
value: 'llvm'
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: '0'
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
Expand Down
38 changes: 18 additions & 20 deletions FreeRTOS-Cpp/include/FreeRTOS/EventGroups.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ class EventGroupBase {
EventGroupBase(const EventGroupBase&) = delete;
EventGroupBase& operator=(const EventGroupBase&) = delete;

static void* operator new(size_t, void*);
static void* operator new[](size_t, void*);
static void* operator new(size_t, void* ptr) { return ptr; }
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

// NOLINTNEXTLINE
using EventBits = std::bitset<((configUSE_16_BIT_TICKS == 1) ? 8 : 24)>;
Expand Down Expand Up @@ -380,7 +378,21 @@ class EventGroupBase {
* FreeRTOS::EventGroup or FreeRTOS::StaticEventGroup.
*/
EventGroupBase() = default;
~EventGroupBase() = default;

/**
* EventGroup.hpp
*
* @brief Destroy the EventGroupBase object by calling <tt>void
* vEventGroupDelete( EventGroupHandle_t xEventGroup )</tt>
*
* @see <https://www.freertos.org/vEventGroupDelete.html>
*
* Delete an event group.
*
* Tasks that are blocked on the event group being deleted will be unblocked,
* and report an event group value of 0.
*/
~EventGroupBase() { vEventGroupDelete(this->handle); };

EventGroupBase(EventGroupBase&&) noexcept = default;
EventGroupBase& operator=(EventGroupBase&&) noexcept = default;
Expand Down Expand Up @@ -425,21 +437,7 @@ class EventGroup : public EventGroupBase {
* @include EventGroups/eventGroup.cpp
*/
EventGroup() { this->handle = xEventGroupCreate(); }

/**
* EventGroup.hpp
*
* @brief Destroy the EventGroup object by calling <tt>void vEventGroupDelete(
* EventGroupHandle_t xEventGroup )</tt>
*
* @see <https://www.freertos.org/vEventGroupDelete.html>
*
* Delete an event group.
*
* Tasks that are blocked on the event group being deleted will be unblocked,
* and report an event group value of 0.
*/
~EventGroup() { vEventGroupDelete(this->handle); }
~EventGroup() = default;

EventGroup(const EventGroup&) = delete;
EventGroup& operator=(const EventGroup&) = delete;
Expand Down
34 changes: 16 additions & 18 deletions FreeRTOS-Cpp/include/FreeRTOS/MessageBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ class MessageBufferBase {
MessageBufferBase(const MessageBufferBase&) = delete;
MessageBufferBase& operator=(const MessageBufferBase&) = delete;

static void* operator new(size_t, void*);
static void* operator new[](size_t, void*);
static void* operator new(size_t, void* ptr) { return ptr; }
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* MessageBuffer.hpp
Expand Down Expand Up @@ -391,7 +389,19 @@ class MessageBufferBase {

private:
MessageBufferBase() = default;
~MessageBufferBase() = default;

/**
* MessageBuffer.hpp
*
* @brief Destroy the MessageBufferBase object by calling <tt>void
* vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer )</tt>
*
* @see <https://www.freertos.org/vMessageBufferDelete.html>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~MessageBufferBase() { vMessageBufferDelete(this->handle); }

MessageBufferBase(MessageBufferBase&&) noexcept = default;
MessageBufferBase& operator=(MessageBufferBase&&) noexcept = default;
Expand Down Expand Up @@ -439,19 +449,7 @@ class MessageBuffer : public MessageBufferBase {
explicit MessageBuffer(size_t size) {
this->handle = xMessageBufferCreate(size);
}

/**
* MessageBuffer.hpp
*
* @brief Destroy the MessageBuffer object by calling <tt>void
* vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer )</tt>
*
* @see <https://www.freertos.org/vMessageBufferDelete.html>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~MessageBuffer() { vMessageBufferDelete(this->handle); }
~MessageBuffer() = default;

MessageBuffer(const MessageBuffer&) = delete;
MessageBuffer& operator=(const MessageBuffer&) = delete;
Expand Down
50 changes: 17 additions & 33 deletions FreeRTOS-Cpp/include/FreeRTOS/Mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ class MutexBase {
MutexBase(const MutexBase&) = delete;
MutexBase& operator=(const MutexBase&) = delete;

static void* operator new(size_t, void*);
static void* operator new[](size_t, void*);
static void* operator new(size_t, void* ptr) { return ptr; }
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Mutex.hpp
Expand Down Expand Up @@ -159,7 +157,19 @@ class MutexBase {

private:
MutexBase() = default;
~MutexBase() = default;

/**
* Mutex.hpp
*
* @brief Destroy the MutexBase object by calling <tt>void vSemaphoreDelete(
* SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~MutexBase() { vSemaphoreDelete(this->handle); }

MutexBase(MutexBase&&) noexcept = default;
MutexBase& operator=(MutexBase&&) noexcept = default;
Expand Down Expand Up @@ -194,8 +204,6 @@ class RecursiveMutexBase : public MutexBase {
static void* operator new[](size_t, void*);
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Mutex.hpp
Expand Down Expand Up @@ -298,19 +306,7 @@ class Mutex : public MutexBase {
* @include Mutex/mutex.cpp
*/
Mutex() { this->handle = xSemaphoreCreateMutex(); }

/**
* Mutex.hpp
*
* @brief Destroy the Mutex object by calling <tt>void vSemaphoreDelete(
* SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~Mutex() { vSemaphoreDelete(this->handle); }
~Mutex() = default;

Mutex(const Mutex&) = delete;
Mutex& operator=(const Mutex&) = delete;
Expand Down Expand Up @@ -363,19 +359,7 @@ class RecursiveMutex : public RecursiveMutexBase {
* @include Mutex/recursiveMutex.cpp
*/
RecursiveMutex() { this->handle = xSemaphoreCreateRecursiveMutex(); }

/**
* Mutex.hpp
*
* @brief Destroy the RecursiveMutex object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a mutex that has tasks blocked on it (tasks that are in
* the Blocked state waiting for the mutex to become available).
*/
~RecursiveMutex() { vSemaphoreDelete(this->handle); }
~RecursiveMutex() = default;

RecursiveMutex(const RecursiveMutex&) = delete;
RecursiveMutex& operator=(const RecursiveMutex&) = delete;
Expand Down
34 changes: 16 additions & 18 deletions FreeRTOS-Cpp/include/FreeRTOS/Queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ class QueueBase {
QueueBase(const QueueBase&) = delete;
QueueBase& operator=(const QueueBase&) = delete;

static void* operator new(size_t, void*);
static void* operator new[](size_t, void*);
static void* operator new(size_t, void* ptr) { return ptr; }
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Queue.hpp
Expand Down Expand Up @@ -610,7 +608,19 @@ class QueueBase {
* FreeRTOS::Queue or FreeRTOS::StaticQueue.
*/
QueueBase() = default;
~QueueBase() = default;

/**
* Queue.hpp
*
* @brief Destroy the QueueBase object by calling <tt>void vQueueDelete(
* QueueHandle_t xQueue )</tt>
*
* @see <https://www.freertos.org/a00018.html#vQueueDelete>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~QueueBase() { vQueueDelete(this->handle); }

QueueBase(QueueBase&&) noexcept = default;
QueueBase& operator=(QueueBase&&) noexcept = default;
Expand Down Expand Up @@ -659,19 +669,7 @@ class Queue : public QueueBase<T> {
explicit Queue(const UBaseType_t length) {
this->handle = xQueueCreate(length, sizeof(T));
}

/**
* Queue.hpp
*
* @brief Destroy the Queue object by calling <tt>void vQueueDelete(
* QueueHandle_t xQueue )</tt>
*
* @see <https://www.freertos.org/a00018.html#vQueueDelete>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*/
~Queue() { vQueueDelete(this->handle); }
~Queue() = default;

Queue(const Queue&) = delete;
Queue& operator=(const Queue&) = delete;
Expand Down
51 changes: 17 additions & 34 deletions FreeRTOS-Cpp/include/FreeRTOS/Semaphore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ class SemaphoreBase {
SemaphoreBase(const SemaphoreBase&) = delete;
SemaphoreBase& operator=(const SemaphoreBase&) = delete;

static void* operator new(size_t, void*);
static void* operator new[](size_t, void*);
static void* operator new(size_t, void* ptr) { return ptr; }
static void* operator new[](size_t, void* ptr) { return ptr; }
static void* operator new(size_t) = delete;
static void* operator new[](size_t) = delete;
static void operator delete(void*) = delete;
static void operator delete[](void*) = delete;

/**
* Semaphore.hpp
Expand Down Expand Up @@ -241,7 +239,19 @@ class SemaphoreBase {

private:
SemaphoreBase() = default;
~SemaphoreBase() = default;

/**
* Semaphore.hpp
*
* @brief Destroy the SemaphoreBase object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*/
~SemaphoreBase() { vSemaphoreDelete(this->handle); }

SemaphoreBase(SemaphoreBase&&) noexcept = default;
SemaphoreBase& operator=(SemaphoreBase&&) noexcept = default;
Expand Down Expand Up @@ -314,19 +324,7 @@ class BinarySemaphore : public SemaphoreBase {
* @include Semaphore/binarySemaphore.cpp
*/
BinarySemaphore() { this->handle = xSemaphoreCreateBinary(); }

/**
* Semaphore.hpp
*
* @brief Destroy the BinarySemaphore object by calling <tt>void
* vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*/
~BinarySemaphore() { vSemaphoreDelete(this->handle); }
~BinarySemaphore() = default;

BinarySemaphore(const BinarySemaphore&) = delete;
BinarySemaphore& operator=(const BinarySemaphore&) = delete;
Expand Down Expand Up @@ -391,22 +389,7 @@ class CountingSemaphore : public SemaphoreBase {
const UBaseType_t initialCount = 0) {
this->handle = xSemaphoreCreateCounting(maxCount, initialCount);
}

/**
* Semaphore.hpp
*
* @brief Destroy the CountingSemaphore object by calling
* <tt>void vSemaphoreDelete( SemaphoreHandle_t xSemaphore )</tt>
*
* @see <https://www.freertos.org/a00113.html#vSemaphoreDelete>
*
* @note Do not delete a semaphore that has tasks blocked on it (tasks that
* are in the Blocked state waiting for the semaphore to become available).
*
* <b>Example Usage</b>
* @include Semaphore/countingSemaphore.cpp
*/
~CountingSemaphore() { vSemaphoreDelete(this->handle); }
~CountingSemaphore() = default;

CountingSemaphore(const CountingSemaphore&) = delete;
CountingSemaphore& operator=(const CountingSemaphore&) = delete;
Expand Down
Loading

0 comments on commit 4bda404

Please sign in to comment.