From b6c7888321694299ff82acd920b73d7f91cf1951 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Fri, 9 Feb 2024 19:20:52 +0100 Subject: [PATCH] Blink LED on startup Afterwards, the LED shows whether the fan is (or should be) currently on. --- src/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 61a6d62..cb1420b 100644 --- a/src/main.c +++ b/src/main.c @@ -79,10 +79,16 @@ int main(void) timebase_ms += 1000 / SYSTICK_FREQ; - //uint32_t timebase_ms_fast = timebase_ms & 0xFFFFFFFF; + uint32_t timebase_ms_fast = timebase_ms & 0xFFFFFFFF; - // start the measurement in the background. - temp_sensor_trigger_update(); + if(timebase_ms_fast <= 1000) { + if((timebase_ms_fast % 100) == 0) { + gpio_toggle(LED_PORT, LED_PIN); + } + } else { + // start the measurement in the background. + temp_sensor_trigger_update(); + } } // check for completion of a measurement