From 6bb7e001aa88a532cb1bea7951f9e91f2d3199e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Wed, 5 May 2021 14:54:13 +0200 Subject: [PATCH] application: monitor, make increment overflow safe --- application.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.c b/application.c index 1e681ae..11ffd12 100644 --- a/application.c +++ b/application.c @@ -496,7 +496,7 @@ static void command_monitor(void* argument) const bool pin = (port & channel_pins[i]); // get the pin level on which the channel is if (pin != channels_level[i]) { // data on this channel changed channel_changed = true; // remember one channel changed - channels_changed[i]++; // remember how many times this channel changed + channels_changed[i] = addu8_safe(channels_changed[i], 1); // remember how many times this channel changed channels_level[i] = pin; // save new level } }