Accept T as copy instead of referende

xQueueSend() copies the value, so accepting a reference is misleading
This commit is contained in:
GHOSCHT 2023-03-25 18:09:11 +01:00
parent 428a0f437f
commit 96c39d4792
No known key found for this signature in database

View file

@ -26,7 +26,7 @@ public:
size_t size() { return uxQueueMessagesWaiting(handle); } size_t size() { return uxQueueMessagesWaiting(handle); }
size_t available() { return uxQueueSpacesAvailable(handle); } size_t available() { return uxQueueSpacesAvailable(handle); }
size_t capacity() { return queueCapacity; } size_t capacity() { return queueCapacity; }
bool push(const T &item, const TickType_t ticksToWait = portMAX_DELAY) { bool push(const T item, const TickType_t ticksToWait = portMAX_DELAY) {
return xQueueSend(handle, &item, ticksToWait) == pdTRUE; return xQueueSend(handle, &item, ticksToWait) == pdTRUE;
} }
etl::optional<T> pop(const TickType_t ticksToWait = portMAX_DELAY) { etl::optional<T> pop(const TickType_t ticksToWait = portMAX_DELAY) {