Commit b6bcda32 authored by Pavel Semerad's avatar Pavel Semerad
Browse files

added global setting to disable center/reset value beep

parent 4a622d17
*0.4.2 ()
added global setting to disable center/reset value beep
*0.4.1 (17 Aug 2011)
......
......@@ -226,6 +226,7 @@ Global setup menu:
1 dead zone for steering 0...50
2 dead zone for throttle 0...50
b key beep OFF/ON
C center/reset beep OFF/ON
d long press key delay 100...1000 miliseconds
r + ALL global reset - change to YES to set global configuration
and all models to default values
......
......@@ -53,6 +53,8 @@ u8 config_global_set_default(void) {
cg.long_press_delay = 1000 / 5; // 1sec
cg.inactivity_alarm = 0;
cg.key_beep = 1;
cg.reset_beep = 1;
cg.unused = 0;
// set calibrate values only when they are out of limits
cc |= check_val(&cg.calib_steering_left, 0, CALIB_ST_LOW_MID, 0);
......
......@@ -50,7 +50,9 @@ typedef struct {
u8 endpoint_max; // max allowed endpoint value (def 120%)
u8 long_press_delay; // long press delay in 5ms steps
u8 inactivity_alarm:4; // time (min) of inactivity warning
u8 key_beep:1;
u8 key_beep:1; // beep on key press
u8 reset_beep:1; // beep on center/reset value
u8 unused:2;
} config_global_s;
extern config_global_s config_global;
......
......@@ -177,6 +177,18 @@ static void gs_key_beep(u8 change) {
}
static void gs_reset_beep(u8 change) {
if (change == 0xff) {
lcd_set(L7SEG, LB_EMPTY);
return;
}
if (change) cg.reset_beep ^= 1;
lcd_7seg(L7_C);
if (cg.reset_beep) lcd_chars("ON ");
else lcd_chars("OFF");
}
static void gs_long_press_delay(u8 change) {
u8 *addr = &cg.long_press_delay;
if (change == 0xff) {
......@@ -264,6 +276,7 @@ static const global_setup_t gs_config[] = {
gs_steering_dead,
gs_throttle_dead,
gs_key_beep,
gs_reset_beep,
gs_long_press_delay,
gs_reset_all,
gs_reset_model_all,
......
......@@ -59,7 +59,7 @@ void menu_buttons_initialize(void) {
static @near s16 menu_buttons_previous_values[NUM_KEYS + 2 * NUM_TRIMS];
#define BEEP_RESET buzzer_on(20, 0, 1)
#define BEEP_RESET if (cg.reset_beep) buzzer_on(20, 0, 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment