From 9f29c6377d9d230ad152d6f7669cf20dd7c8c33b Mon Sep 17 00:00:00 2001 From: Martin Hugh Date: Wed, 21 Feb 2024 08:38:32 +0000 Subject: [PATCH] Set_Blue_LED_optimisation --- src/hardware.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hardware.c b/src/hardware.c index 5fc096d..df6fced 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -1515,11 +1515,15 @@ void LED_Task() { void Set_Blue_LED(uint8_t flag) { if (flag) { - LED_BLUE_ON; - led_status = ON; + if (led_status == OFF) { + LED_BLUE_ON; + led_status = ON; + } } else { - LED_BLUE_OFF; - led_status = OFF; + if (led_status == ON) { + LED_BLUE_OFF; + led_status = OFF; + } } }