Skip to content

Commit 381b7ef

Browse files
committed
even simpler HandlerResult syntax
1 parent 5a91bdd commit 381b7ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ void loop() {
3939
Make a function to call (without arguments) when a *Timer* expires.
4040
```cpp
4141
Timers::HandlerResult function_to_call() {
42-
return { Timers::TimerStatus::repeat }; // to repeat the action - 'completed' to stop
42+
return Timers::TimerStatus::repeat; // to repeat the action - 'completed' to stop
4343
}
4444
```
4545

4646
Make a function to call (with an argument) when a *Timer* expires.
4747
```cpp
4848
Timers::HandlerResult function_to_call_with_arg(int value) {
49-
return { Timers::TimerStatus::completed }; // to stop the timer - 'repeat' to repeat the action
49+
return Timers::TimerStatus::completed; // to stop the timer - 'repeat' to repeat the action
5050
}
5151
```
5252
@@ -58,7 +58,7 @@ Timers::HandlerResult function_to_call_and_reschedule() {
5858
if (digitalRead(4)) {
5959
return { Timers::TimerStatus::reschedule, 5000 }; // to change the repeat interval to 5000 ms
6060
} else {
61-
return { Timers::TimerStatus::repeat }; // to repeat the action - 'completed' to stop
61+
return Timers::TimerStatus::repeat; // to repeat the action - 'completed' to stop
6262
}
6363
}
6464
```
@@ -155,7 +155,7 @@ auto timerset = Timers::create_default(); // create a timerset with default sett
155155
156156
Timers::HandlerResult toggle_led() {
157157
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // toggle the LED
158-
return { Timers::TimerStatus::repeat }; // keep timer active? true
158+
return Timers::TimerStatus::repeat; // keep timer active? true
159159
}
160160
161161
void setup() {

0 commit comments

Comments
 (0)