From a69f4a4400a63d4a82ba587f061455f17ccf80e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Sok=C3=B3=C5=82?= Date: Sun, 18 Dec 2016 01:03:48 +0100 Subject: [PATCH] stc15_dusk cleanup --- src/stc15_dusk.c | 4 +++- src/stc15_dusk.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stc15_dusk.c b/src/stc15_dusk.c index 0d3cb5a..a7b70d2 100644 --- a/src/stc15_dusk.c +++ b/src/stc15_dusk.c @@ -1,5 +1,7 @@ #include "stc15_dusk.h" +#define STC15_LIGHT_THRESHOLD 219 + unsigned char dusk_value = 0; void nop_wait() { @@ -25,6 +27,6 @@ void stc15_update_light_state() { } unsigned char stc15_is_low_light() { - return dusk_value > 219; + return dusk_value > STC15_LIGHT_THRESHOLD; } diff --git a/src/stc15_dusk.h b/src/stc15_dusk.h index 7499d2e..648bc4d 100644 --- a/src/stc15_dusk.h +++ b/src/stc15_dusk.h @@ -15,7 +15,6 @@ void stc15_dusk_init(); -/* should be called periodically */ void stc15_update_light_state(); unsigned char stc15_is_low_light();