]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/buttons.c
buttons.c: faster brake sensor reaction time
[bike-lights.git] / firmware / buttons.c
index d839e8dcdfcba73cf785cc065eebbd3e91c4a652..4f7a5ceb184f2d804c50ac76c74e547ca6bbd556 100644 (file)
@@ -52,7 +52,9 @@ union {
  * mode.
  */
 static unsigned char user_params[N_USER_PARAMS] = { 0, 0, 0 };
-static unsigned char user_params_max[N_USER_PARAMS] = { 3, 2, 2 };
+static unsigned char user_params_max[N_USER_PARAMS] = {
+       N_AMBIENT_ZONES+1, 2, 2
+};
 
 static unsigned char user_params_state = 0;
        /*
@@ -233,7 +235,7 @@ static void handle_brake(unsigned char cur, unsigned char prev)
                                              // --- no change ---
        duration = jiffies - button_start[2];
 
-       if (duration <= 3)
+       if (duration == 0) // at least two jiffies
                return;
 
        if (cur) {