From 191292298cb18a5b466f1d97e107a1593c955c23 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Thu, 24 Oct 2024 23:37:52 +0200 Subject: [PATCH] use a constant for sleep delay --- ambientd.c3 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ambientd.c3 b/ambientd.c3 index 8d24f80..df3c564 100644 --- a/ambientd.c3 +++ b/ambientd.c3 @@ -18,6 +18,8 @@ const int MAX_LUMINANCE = 700; // minimum display brightness in percent const float MIN_BRIGHTNESS_PERCENT = 0.05; +const int SLEEP_DELAY = 3000; + macro abs(x) { return x < 0 ? -x : x; } macro clamp(x, l, h) { return max(min(x, h), l); } @@ -155,7 +157,7 @@ fn int main() io::eprintfn("Error writing brightness: %s", excuse); } - thread::sleep_ms(3000); + thread::sleep_ms(SLEEP_DELAY); // read actual brightness to get the user offset int! actual_brightness;