Commit 57a47d37 authored by Pavel Semerad's avatar Pavel Semerad
Browse files

poweron warn when not-centered now has separate global option

parent 3b460185
......@@ -2,6 +2,7 @@
global menu was restructuralized
added ability to select number of channels (2-MAX_CHANNELS) for each
model, less channels means less delay
poweron warn when not-centered now has separate global option
*0.4.2 (13 Apr 2012)
added global setting to disable center/reset value beep
......
......@@ -232,8 +232,9 @@ Global setup menu:
number of ADC values A_4/A_1
b beeps
key beep K_N/K_Y
value at center/reset beep C_N/C_Y
value at center/reset beep V_N/V_Y
poweron beep P_N/P_Y
poweron not-centered warn C_N/C_Y
d long press key delay 100...1000 miliseconds
r global or all models reset
all configs (global+model) G_N/G_Y (No/Yes)
......
not-centered poweron warning with separate global option
? linear CH3 with potentiometer
timer
- up/down/lap
- ignore lap button after press for 3 seconds to eliminate double clicks
......@@ -40,6 +37,7 @@ timer losikid
look at times
reset all data
? linear CH3 with potentiometer
? selectable frame length with constant frame/constant sync
? more multi-positions - 2 for 6ch, 4 for 8ch, 4-pos is enought
? use also flash memory to store model configs
......
......@@ -719,20 +719,21 @@ void menu_init(void) {
reset_inactivity_timer();
}
else {
u16 steering = ADC_OVS(steering);
u16 throttle = ADC_OVS(throttle);
apply_global_config();
reset_inactivity_timer();
if (cg.poweron_beep) {
u16 steering = ADC_OVS(steering);
u16 throttle = ADC_OVS(throttle);
// if actual steering/throttle value is not in dead zone, beep 3 times
if (steering < (cg.calib_steering_mid - cg.steering_dead_zone) ||
steering > (cg.calib_steering_mid + cg.steering_dead_zone) ||
throttle < (cg.calib_throttle_mid - cg.throttle_dead_zone) ||
throttle > (cg.calib_throttle_mid + cg.throttle_dead_zone))
// if actual steering/throttle value is not in dead zone, beep 3 times
if (cg.poweron_warn &&
(steering < (cg.calib_steering_mid - cg.steering_dead_zone) ||
steering > (cg.calib_steering_mid + cg.steering_dead_zone) ||
throttle < (cg.calib_throttle_mid - cg.throttle_dead_zone) ||
throttle > (cg.calib_throttle_mid + cg.throttle_dead_zone)))
buzzer_on(30, 30, 3);
// else beep 1 times
else beep(30);
}
// else beep 1 times
else if (cg.poweron_beep) beep(30);
}
// read model config from eeprom
......
......@@ -237,12 +237,15 @@ static u8 gs_beep(u8 val_id, u8 action, u8 *chars_blink) {
case 3:
cg.poweron_beep ^= 1;
break;
case 4:
cg.poweron_warn ^= 1;
break;
}
}
// select next value
else if (action == 2) {
if (++id > 3) id = 1;
if (++id > 4) id = 1;
}
// show values
......@@ -255,13 +258,17 @@ static u8 gs_beep(u8 val_id, u8 action, u8 *chars_blink) {
lcd_char(LCHR3, (u8)(cg.key_beep ? 'Y' : 'N'));
break;
case 2:
lcd_char(LCHR1, 'C');
lcd_char(LCHR1, 'V');
lcd_char(LCHR3, (u8)(cg.reset_beep ? 'Y' : 'N'));
break;
case 3:
lcd_char(LCHR1, 'P');
lcd_char(LCHR3, (u8)(cg.poweron_beep ? 'Y' : 'N'));
break;
case 4:
lcd_char(LCHR1, 'C');
lcd_char(LCHR3, (u8)(cg.poweron_warn ? 'Y' : 'N'));
break;
}
return id;
......
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