From 28656ba8d230fc14bab6445439fb5c1b966dddbe Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Thu, 22 Nov 2012 00:58:01 +0100 Subject: [PATCH] buttons.c: param setup fixes --- firmware/buttons.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/buttons.c b/firmware/buttons.c index aa35026..679d958 100644 --- a/firmware/buttons.c +++ b/firmware/buttons.c @@ -79,7 +79,7 @@ static inline void short_press(unsigned char button) if (user_params[param]) user_params[param]--; else - user_params[param] = user_params_max[param]; + user_params[param] = user_params_max[param]-1; } else { user_params[param]++; @@ -103,7 +103,7 @@ static inline void long_press(unsigned char button) // button 1 - cycle through states user_params_state++; - if (user_params_state >= MAX_USER_PARAMS) + if (user_params_state > MAX_USER_PARAMS) user_params_state = 1; set_status_led(0, status_pattern_select(0)); @@ -159,7 +159,7 @@ void timer_check_buttons() prev_pin = pin; - if (user_params_state && jiffies - user_params_starttime > 500) { + if (user_params_state && jiffies - user_params_starttime > 1000) { user_params_state = 0; set_status_led(0, status_pattern_select(0)); set_status_led(1, status_pattern_select(1)); -- 2.43.5