Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Delete start parameter in timer.create() (passed in timer.setup) #7

Merged
merged 1 commit into from
Apr 6, 2024
Merged
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
10 changes: 5 additions & 5 deletions src/RTOScppTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
};

Expand All @@ -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:
Expand Down