Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 0b81722

Browse files
InteractionProvider: move all variable initializations to constructor
1 parent 1c8ec60 commit 0b81722

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,16 @@ MbedClient mbed_client(device);
7676
* for regular updates for the resources.
7777
*
7878
* MBED_CONF_APP_BUTTON1 is mapped to actual button pin the mbed_app.json file, where you need to
79-
* specify board-specific values or leave them undefined if the board does not have buttons.
79+
* specify board-specific value or leave it undefined if the board does not have buttons.
8080
*/
8181
class InteractionProvider {
8282

8383
public:
8484
InteractionProvider(Semaphore& updates_sem) : updates(updates_sem) {
8585

86+
timer_ticked = false;
87+
clicked = false;
88+
8689
// Set up handler function for the interaction button, if available
8790

8891
#ifdef MBED_CONF_APP_BUTTON1
@@ -95,8 +98,8 @@ class InteractionProvider {
9598
}
9699

97100
// flags for interaction, these are read from outside interrupt context
98-
volatile bool timer_ticked = false;
99-
volatile bool clicked = false;
101+
volatile bool timer_ticked;
102+
volatile bool clicked;
100103

101104

102105
private:

0 commit comments

Comments
 (0)