diff options
Diffstat (limited to 'src/tempmodule/indicator.c')
-rw-r--r-- | src/tempmodule/indicator.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tempmodule/indicator.c b/src/tempmodule/indicator.c index 774c801..4c1b958 100644 --- a/src/tempmodule/indicator.c +++ b/src/tempmodule/indicator.c @@ -57,8 +57,13 @@ void indicator_init(unsigned int temp, unsigned int const * const calibration) } -void indicator_update(unsigned int temp) +void indicator_update(const unsigned int temp, const unsigned int on) { + if (!on) { + indicator_set_state(0, 0, 0); + return; + } + if (temp > state.calibration[0]) { indicator_set_state(1, 0, 0); } else if (temp > state.calibration[1]) { @@ -75,7 +80,7 @@ void indicator_update(unsigned int temp) void indicator_calibrate(unsigned int const * const calibration) { memcpy(state.calibration, calibration, sizeof(state.calibration)); - indicator_update(state.current_temp); + indicator_update(state.current_temp, 1); } static void indicator_set_state(unsigned int red, unsigned int green, unsigned int blue) |