make this snake_case for consistency

This commit is contained in:
Joey Castillo 2021-08-03 11:54:43 -04:00
parent 6cb7e38be2
commit 8a06636833

View File

@ -25,7 +25,7 @@ typedef struct ApplicationState {
bool debounce_wait; bool debounce_wait;
} ApplicationState; } ApplicationState;
ApplicationState applicationState; ApplicationState application_state;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
@ -47,7 +47,7 @@ void cb_alarm_pressed();
* internal data structures or application state required by your app. * internal data structures or application state required by your app.
*/ */
void app_init() { void app_init() {
memset(&applicationState, 0, sizeof(applicationState)); memset(&application_state, 0, sizeof(application_state));
} }
/** /**
@ -91,7 +91,7 @@ void app_setup() {
* a press on one of the buttons). * a press on one of the buttons).
*/ */
void app_prepare_for_sleep() { void app_prepare_for_sleep() {
applicationState.debounce_wait = false; application_state.debounce_wait = false;
} }
/** /**
@ -99,7 +99,7 @@ void app_prepare_for_sleep() {
* STANDBY sleep mode. * STANDBY sleep mode.
*/ */
void app_wake_from_sleep() { void app_wake_from_sleep() {
applicationState.wake_count++; application_state.wake_count++;
} }
/** /**
@ -108,7 +108,7 @@ void app_wake_from_sleep() {
*/ */
bool app_loop() { bool app_loop() {
// set the LED to a color // set the LED to a color
switch (applicationState.color) { switch (application_state.color) {
case COLOR_OFF: case COLOR_OFF:
watch_set_led_off(); watch_set_led_off();
break; break;
@ -125,11 +125,11 @@ bool app_loop() {
// Display the number of times we've woken up (modulo 32 to fit in 2 digits at top right) // Display the number of times we've woken up (modulo 32 to fit in 2 digits at top right)
char buf[3] = {0}; char buf[3] = {0};
sprintf(buf, "%2d", applicationState.wake_count % 32); sprintf(buf, "%2d", application_state.wake_count % 32);
watch_display_string(buf, 2); watch_display_string(buf, 2);
// display "Hello there" text // display "Hello there" text
switch (applicationState.mode) { switch (application_state.mode) {
case MODE_HELLO: case MODE_HELLO:
watch_display_string("Hello", 5); watch_display_string("Hello", 5);
break; break;
@ -149,15 +149,15 @@ bool app_loop() {
// Implementations for our callback functions. Replace these with whatever functionality // Implementations for our callback functions. Replace these with whatever functionality
// your app requires. // your app requires.
void cb_light_pressed() { void cb_light_pressed() {
if (applicationState.debounce_wait) return; if (application_state.debounce_wait) return;
applicationState.debounce_wait = true; application_state.debounce_wait = true;
applicationState.color = (applicationState.color + 1) % 4; application_state.color = (application_state.color + 1) % 4;
} }
void cb_mode_pressed() { void cb_mode_pressed() {
if (applicationState.debounce_wait) return; if (application_state.debounce_wait) return;
applicationState.debounce_wait = true; application_state.debounce_wait = true;
applicationState.mode = (applicationState.mode + 1) % 2; application_state.mode = (application_state.mode + 1) % 2;
} }
void cb_alarm_pressed() { void cb_alarm_pressed() {