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

at poweron and steering/throttle not in center, do not show calibrate screen, but beep 3 times

parent 9c201b39
......@@ -4,9 +4,8 @@
PPM length shortened to "NUM_CHANNELS x 2ms + 5ms" to send new data
to receiver as soon as possible
ADC measuring every 1ms, averaging last 4 samples when used
after poweron, if steering or throttle are not in center dead zone,
show calibration screen, because recalibration will be probably
needed
at poweron, if steering or throttle are not in center dead zone,
beep 3 times
added poweron beep, can be set ON/OFF in global config
inactivity timer compares ADC values with previous ones, so now
it will activate when radio is not center callibrated also
......
......@@ -800,19 +800,24 @@ void menu_init(void) {
menu_key_mapping_prepare();
// read global config from eeprom, if calibrate values was set to defaults,
// or if actual steering/throttle value is not in dead zone,
// call calibrate
if (config_global_read() ||
adc_steering_last < (cg.calib_steering_mid - cg.steering_dead_zone) ||
adc_steering_last > (cg.calib_steering_mid + cg.steering_dead_zone) ||
adc_throttle_last < (cg.calib_throttle_mid - cg.throttle_dead_zone) ||
adc_throttle_last > (cg.calib_throttle_mid + cg.throttle_dead_zone)) {
menu_calibrate(1);
btnra();
if (config_global_read()) {
menu_calibrate(1);
btnra();
reset_inactivity_timer();
}
else {
apply_global_config();
reset_inactivity_timer();
// if actual steering/throttle value is not in dead zone, beep 3 times
if (adc_steering_last < (cg.calib_steering_mid - cg.steering_dead_zone) ||
adc_steering_last > (cg.calib_steering_mid + cg.steering_dead_zone) ||
adc_throttle_last < (cg.calib_throttle_mid - cg.throttle_dead_zone) ||
adc_throttle_last > (cg.calib_throttle_mid + cg.throttle_dead_zone))
buzzer_on(30, 30, 3);
// else beep 1 times when allowed
else if (cg.poweron_beep) beep(30);
}
else if (cg.poweron_beep) beep(30);
apply_global_config();
reset_inactivity_timer();
// read model config from eeprom, but not awake CALC yet
menu_load_model();
......
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