From 39b2eb11e292676458a0d0279eab7b3aaac711f82997610a24ba8e6a7b44ec6e Mon Sep 17 00:00:00 2001 From: localhorst Date: Sun, 9 Nov 2025 17:18:43 +0100 Subject: [PATCH] cleanup --- main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index ad8f14a..6084781 100644 --- a/main.c +++ b/main.c @@ -24,6 +24,8 @@ #define BUTTON_IGNORE_DURATION_MS 2000U // Time button ignored after long press #define BUTTON_CONFIRMATION_BLINK_LOOPS 10U // Blink animation for confirmation #define BUTTON_CONFIRMATION_BLINK_DURATION_MS 50U +#define GLOW_BRIGHTNESS_MIN 10U +#define GLOW_BRIGHTNESS_MAX 100U /** Convert milliseconds to system ticks */ #define MS_TO_TICKS(ms) ((ms) / MAIN_LOOP_SLEEP) @@ -111,7 +113,6 @@ int main(void) set_sleep_mode(SLEEP_MODE_STANDBY); // Deepest sleep mode (standby) sleep_enable(); // Enable sleep - cli(); // Disable global interrupts sei(); // Re-enable interrupts sleep_cpu(); // MCU sleeps here } @@ -428,14 +429,14 @@ void ledAnimationGlow(void) brightness += direction; // Reverse direction at limits - if (brightness >= 100U) + if (brightness >= GLOW_BRIGHTNESS_MAX) { - brightness = 100U; + brightness = GLOW_BRIGHTNESS_MAX; direction = -1; } - else if (brightness == 10U) + else if (brightness == GLOW_BRIGHTNESS_MIN) { - brightness = 10U; + brightness = GLOW_BRIGHTNESS_MIN; direction = 1; }