main: clear RUN LED before operation
This commit is contained in:
parent
aa5828e22b
commit
a66a60fbad
1
main.c
1
main.c
|
@ -222,6 +222,7 @@ void main(void)
|
||||||
if (rw_button_pressed) {
|
if (rw_button_pressed) {
|
||||||
wait_10us(100); // wait 1 ms for the noise to be gone
|
wait_10us(100); // wait 1 ms for the noise to be gone
|
||||||
if (0 == (RW_BUTTON_PORT->IDR.reg & RW_BUTTON_PIN)) { // ensure the button is pressed (the pull-up is really weak)
|
if (0 == (RW_BUTTON_PORT->IDR.reg & RW_BUTTON_PIN)) { // ensure the button is pressed (the pull-up is really weak)
|
||||||
|
run_led_off(); // clear RUN LED to see result at the end
|
||||||
wait_10us(10000); // debounce for 100 ms
|
wait_10us(10000); // debounce for 100 ms
|
||||||
uint8_t press_duration = 1; // start counting how long the button is pressed
|
uint8_t press_duration = 1; // start counting how long the button is pressed
|
||||||
while (0 == (RW_BUTTON_PORT->IDR.reg & RW_BUTTON_PIN)) { // wait until button is depressed
|
while (0 == (RW_BUTTON_PORT->IDR.reg & RW_BUTTON_PIN)) { // wait until button is depressed
|
||||||
|
|
Loading…
Reference in New Issue