main: don't wait more than 3s button press
This commit is contained in:
parent
a710db6915
commit
55b9e429fa
3
main.c
3
main.c
|
@ -228,6 +228,9 @@ void main(void)
|
||||||
wait_10us(10000); // wait for 100 ms
|
wait_10us(10000); // wait for 100 ms
|
||||||
press_duration++;
|
press_duration++;
|
||||||
IWDG_KR = IWDG_KR_KEY_REFRESH; // reset watchdog
|
IWDG_KR = IWDG_KR_KEY_REFRESH; // reset watchdog
|
||||||
|
if (press_duration >= 30) { // 3 seconds already passed
|
||||||
|
break; // stop waiting for button to be released
|
||||||
|
}
|
||||||
}
|
}
|
||||||
led_error = false; // reset error state
|
led_error = false; // reset error state
|
||||||
if (press_duration < 30) { // less than 3 sec
|
if (press_duration < 30) { // less than 3 sec
|
||||||
|
|
Loading…
Reference in New Issue