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

add extra brake channel for throttle brake side

parent cd2d15df
*0.6.1 ()
repaired ABS to use cycle length same as before PPM frame length changes
added extra brake channel for throttle brake side
*0.6.0 (28 Apr 2012)
increased model memories by using FLASH also
......
......@@ -34,7 +34,7 @@ Flashing firmware
Global characteristics:
=======================
- 67 model memories, first 8 in EEPROM, rest in FLASH
- 65 model memories, first 8 in EEPROM, rest in FLASH
> numbers 10-19 will show with Right-Arrow
> numbers 20-29 will show with Left-Arrow
> numbers 30-39 will show with Left+Right-Arrows
......@@ -133,11 +133,12 @@ Standard menu:
> select channel and press ENTER
> select value in range -100..100 and press enter
- mixes 4WS, DIG, throttle brake cut-off (for boats with forward-only
throttle), Multi-Position (to set arbitrary up to 8 positions)
throttle), Multi-Position (to set arbitrary up to 8 positions),
brake channel (to send brake side of throttle to extra channel)
> choose menu EPOINT and press ENTER-long
> menu EPOINT will blink
> select one of mixes 4WS (4), DIG (d), brake cut-off (b),
multi-position (P)
multi-position (P), brake channel (8)
for mixes 4WS, DIG:
> press ENTER and choose channel for this mix or OFF
- for dual-ESC steering (boat, tank, ...) select DIG channel 1 and
......@@ -157,7 +158,9 @@ Standard menu:
> press ENTER and set channel value for second position or END
> ... up to eight position
for brake cut-off:
> set OFF or CUT
> press ENTER and choose OFF or CUT
for brake channel:
> press ENTER and choose channel fro brake or OFF
- Key mapping specific for each model:
> choose menu REV and press ENTER-long
> menu REV will blink
......
......@@ -376,7 +376,6 @@ static void calc_loop(void) {
cg.calib_throttle_mid << ADC_OVS_SHIFT,
cg.calib_throttle_bck << ADC_OVS_SHIFT,
cg.throttle_dead_zone << ADC_OVS_SHIFT);
if (cm.brake_off && val > 0) val = 0; // throttle brake cut off
val = expo(val, (u8)(val < 0 ? cm.expo_forward : cm.expo_back));
if (cm.abs_type) {
// apply selected ABS
......@@ -403,6 +402,16 @@ static void calc_loop(void) {
}
}
val = dualrate(val, (u8)(val < 0 ? cm.dr_forward : cm.dr_back));
// brake to extra channel
if (cm.channel_brake) {
val2 = val;
if (val2 < 0) val2 = 0; // eliminate forward
val2 = val2 * 2 - PPM(500); // to whole servo range
channel_params(cm.channel_brake, channel_speed(val2, cm.channel_brake));
}
// throttle brake cut off
if (cm.brake_off && val > 0) val = 0;
// set to servo
if (!cm.channel_DIG) {
if (cm.brake_off) val = val * 2 + PPM(500);
channel_params(2, channel_speed(val, 2));
......
......@@ -143,6 +143,7 @@ void config_model_set_default(void) {
cm.channel_4WS = 0;
cm.channel_DIG = 0;
cm.channel_brake = 0;
cm.channel_MP0 = 0;
memset(cm.multi_position0, (u8)MULTI_POSITION_END, sizeof(cm.multi_position0));
......@@ -165,6 +166,7 @@ void config_model_set_default(void) {
cm.unused = 0;
cm.unused2 = 0;
cm.unused3 = 0;
memset(cm.reserve, 0, sizeof(cm.reserve));
}
......
......@@ -180,7 +180,10 @@ typedef struct {
u8 abs_type:2;
u8 unused:1;
u16 unused2;
u8 channel_brake:4; // channel for brake side of throttle
u8 unused2:4;
u8 unused3;
config_key_mapping_s key_mapping;
......
......@@ -63,6 +63,8 @@ void apply_model_config(void) {
menu_channels_mixed |= (u8)(1 << (u8)(cm.channel_4WS - 1));
if (cm.channel_DIG)
menu_channels_mixed |= (u8)(1 << (u8)(cm.channel_DIG - 1));
if (cm.channel_brake)
menu_channels_mixed |= (u8)(1 << (u8)(cm.channel_brake - 1));
// set autorepeat
for (i = 0; i < 4; i++) {
......
......@@ -240,6 +240,25 @@ static void mix_brake_off(u8 action) {
}
static void mix_brake_channel(u8 action) {
u8 val = cm.channel_brake;
if (action == MLA_CHG) {
// channel number/off
if (!val) val = 2;
val = (u8)menu_change_val(val, 2, channels, 1, 1);
if (val == 2) val = 0;
cm.channel_brake = val;
}
// show value
lcd_7seg(8);
lcd_segment(LS_SYM_CHANNEL, LS_ON);
// channel number/OFF
if (!val) lcd_chars("OFF");
else lcd_char_num3(val);
}
......@@ -252,6 +271,7 @@ static const menu_list_t mix_funcs[] = {
mix_MultiPosition,
mix_MultiPosition,
mix_brake_off,
mix_brake_channel,
};
......
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