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

add new menu to directly set channel 3-8 value

parent e6bcc513
......@@ -11,6 +11,7 @@
endoder at GT3C
added globally settable PPM constant sync/constant frame + selection
of length
added new menu to directly set channel 3-8 value
*0.4.2 (13 Apr 2012)
added global setting to disable center/reset value beep
......
......@@ -97,7 +97,7 @@ Standard menu:
> set subtrims for each channel
- channel speed
> choose menu D/R and press ENTER-long
> menu D/R wil blink
> menu D/R will blink
> select channel
> for channels 1 and 2 (steering and throttle)
- turn wheel left to show left arrow
......@@ -108,6 +108,13 @@ Standard menu:
> select required speed 1...100%
- 100% means no delay
- 1% means above 4s delay end to end
- directly setting channel value of channels 3..8
> values for 4WS and DIG channels cannot be changed
> this can be used instead of mapping some key to appropriate function
> choose menu EXPO and press ENTER-long
> menu EXPO will blink
> 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)
> choose menu EPOINT and press ENTER-long
......
CH3-8 position settable from menu
linear CH3 with potentiometer
- global option to choose CH3 is a pot
- don't read CH3 key in read_keys()
......
......@@ -197,8 +197,10 @@ static void menu_channel_func(u8 action, menu_channel_t *p) {
// show value
lcd_segment(LS_SYM_CHANNEL, LS_ON);
lcd_7seg((u8)(menu_id + 1));
if (action != MCA_SET_CHG) p->func(menu_id, 0); // skip if changed
if (action != MCA_SET_CHG) { // already showed
lcd_7seg((u8)(menu_id + 1));
p->func(menu_id, 0);
}
if (menu_adc_wakeup) {
// show arrow
if (menu_adc_direction)
......@@ -458,6 +460,23 @@ static void sf_expo(u8 channel, u8 change) {
}
// set channel value, exclude 4WS and DIG channels
// for channels 3..8 so add 2 to channel number
static void sf_channel_val(u8 channel, u8 change) {
s8 *addr = &menu_channel3_8[channel];
if (change && !(menu_channels_mixed & (u8)(1 << (channel + 2))))
*addr = (s8)menu_change_val(*addr, -100, 100, CHANNEL_FAST, 0);
// show value
lcd_7seg((u8)(channel + 2 + 1));
lcd_char_num3(*addr);
}
@inline static void menu_channel_value(void) {
if (channels > 2)
menu_channel((u8)(channels - 2), 0, 0, sf_channel_val);
}
// set abs: OFF, SLO(6), NOR(4), FAS(3)
// pulses between full brake and 1/2 brake and only when enought brake applied
static const u8 abs_labels[][4] = {
......@@ -530,7 +549,10 @@ static void select_menu(void) {
if (btnl(BTN_ENTER)) menu_speed();
else menu_dualrate();
}
else if (menu == LM_EXP) menu_expo();
else if (menu == LM_EXP) {
if (btnl(BTN_ENTER)) menu_channel_value();
else menu_expo();
}
else {
if (btnl(BTN_ENTER)) break;
else menu_abs();
......
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