Embedded-Software-Projects

Log | Files | Refs | README | LICENSE

commit 18add260ad49271e3f70086ae85b6eaed5005101
parent 6bbb373cccca2e72cfb8642ccf9f0e7f986b6b19
Author: William Lindholm <william_lindholm@outlook.com>
Date:   Mon, 14 Oct 2024 22:09:35 +0100

Fixed a bug where voltage reading would linger after mode chage

Diffstat:
MProject1/Project1/main.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/Project1/Project1/main.c b/Project1/Project1/main.c @@ -244,6 +244,12 @@ void display_cylon() // Switch off the current LED LED_Array[i].LED_PORT->OUTCLR = LED_Array[i].bit_mapping; + + if (i < bot_led || i > top_led) + { + i = bot_led; + } + // Move to the next LED i = direction ? i+1 : i-1; @@ -327,6 +333,7 @@ ISR(RTC_PIT_vect) { if (DISPLAY_MODE == SPLIT) { + set_clr_leds(0); // Clear voltage reading after changing back to cylon mode DISPLAY_MODE = CYLON; } else