From 4d9f88c567e37216feb55624ea3481d74a77a333 Mon Sep 17 00:00:00 2001 From: alkonosst Date: Sat, 6 Apr 2024 20:27:35 -0300 Subject: [PATCH] refactor: Delete start parameter in timer.create() (passed in timer.setup) --- src/RTOScppTimer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/RTOScppTimer.h b/src/RTOScppTimer.h index 3f68161..3257a23 100644 --- a/src/RTOScppTimer.h +++ b/src/RTOScppTimer.h @@ -41,7 +41,7 @@ class TimerBase { _start = start; } - virtual bool create(bool start) = 0; + virtual bool create() = 0; bool start(TickType_t ticks_to_wait = portMAX_DELAY) { return xTimerStart(_handle, ticks_to_wait); @@ -92,10 +92,10 @@ class TimerDynamic : public TimerBase { if (start) this->start(); } - bool create(bool start) { + bool create() { _handle = xTimerCreate(_name, _period, _auto_reload, _id, _callback); if (_handle == nullptr) return false; - return start ? this->start() : true; + return _start ? this->start() : true; } }; @@ -111,10 +111,10 @@ class TimerStatic : public TimerBase { if (start) this->start(); } - bool create(bool start) { + bool create() { _handle = xTimerCreateStatic(_name, _period, _auto_reload, _id, _callback, &_tcb); if (_handle == nullptr) return false; - return start ? this->start() : true; + return _start ? this->start() : true; } private: