Skip to content

Commit da7b821

Browse files
committed
Change left(),task_id() to const
1 parent 3124d31 commit da7b821

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/arduino-timer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ class Timer {
116116

117117
/* Left until the task ends */
118118
unsigned long
119-
left(const Task &task)
119+
left(const Task &task) const
120120
{
121121
auto lft = 0ul;
122122
if (!task)
123123
return lft;
124124

125-
timer_foreach_task(t) {
125+
timer_foreach_const_task(t) {
126126
if (t->handler && task_id(t) == task) {
127127
const unsigned long now = time_func();
128128
const unsigned long duration = now - t->start;
@@ -245,7 +245,7 @@ class Timer {
245245

246246
inline
247247
Task
248-
task_id(const struct task * const t)
248+
task_id(const struct task * const t) const
249249
{
250250
const Task id = reinterpret_cast<Task>(t);
251251

0 commit comments

Comments
 (0)