diff --git a/application.c b/application.c index 284e4f7..bdc7e65 100644 --- a/application.c +++ b/application.c @@ -363,13 +363,13 @@ void main(void) button_flag = false; // reset button flag while (true) { // infinite loop iwdg_reset(); // kick the dog - while (user_input_available) { // user input is available + if (user_input_available) { // user input is available action = true; // action has been performed led_toggle(); // toggle LED char c = user_input_get(); // store receive character terminal_send(c); // send received character to terminal } - while (button_flag) { // user pressed button + if (button_flag) { // user pressed button action = true; // action has been performed printf("button pressed\n"); led_toggle(); // toggle LED @@ -378,7 +378,7 @@ void main(void) } button_flag = false; // reset flag } - while (rtc_internal_tick_flag) { // the internal RTC ticked + if (rtc_internal_tick_flag) { // the internal RTC ticked rtc_internal_tick_flag = false; // reset flag action = true; // action has been performed led_toggle(); // toggle LED (good to indicate if main function is stuck)