MixData phases is now inverted to save some flash (thanks Romolo)

Comment on DSM2 fixed in Makefile (thanks Bryan)
Bug fixed in TELEMETRY menu
This commit is contained in:
bsongis
2012-08-17 09:34:38 +00:00
parent 36c981d55f
commit 83fe77fa8e
5 changed files with 9 additions and 11 deletions
+1
View File
@@ -148,6 +148,7 @@ SDCARD = NO
PXX = NO
# DSM2 (Spektrum) protocol
# Values = NO, SERIAL, PPM
DSM2 = NO
#IR protocols (SILV / TRAC09 / PICZ / SWIFT)
+2 -2
View File
@@ -944,11 +944,11 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
break;
case TELEM_MIN_A1-1:
case TELEM_MIN_A2-1:
channel -= TELEM_MIN_A1-1-MAX_TIMERS;
channel -= TELEM_MIN_A1-1;
// no break
case TELEM_A1-1:
case TELEM_A2-1:
channel -= MAX_TIMERS;
channel -= TELEM_A1-1;
// A1 and A2
{
int16_t converted_value = applyChannelRatio(channel, val);
+5 -6
View File
@@ -1337,7 +1337,6 @@ void insertExpoMix(uint8_t expo, uint8_t idx)
MixData *mix = mixaddress(idx);
memmove(mix+1, mix, (MAX_MIXERS-(idx+1))*sizeof(MixData));
memclear(mix, sizeof(MixData));
mix->phases = 1 << getFlightPhase();
mix->destCh = s_currCh-1;
mix->srcRaw = (s_currCh > 4 ? s_currCh : channel_order(s_currCh));
mix->weight = 100;
@@ -1696,7 +1695,7 @@ void menuProcMixOne(uint8_t event)
case MIX_FIELD_FLIGHT_PHASE:
lcd_putsLeft(y, STR_FPHASE);
for (uint8_t p=0; p<MAX_PHASES; p++)
lcd_putcAtt(MIXES_2ND_COLUMN+p*FW, y, '0'+p, ((m_posHorz==p) && attr) ? BLINK|INVERS : ((md2->phases & (1<<p)) ? INVERS : 0 ));
lcd_putcAtt(MIXES_2ND_COLUMN+p*FW, y, '0'+p, ((m_posHorz==p) && attr) ? BLINK|INVERS : ((md2->phases & (1<<p)) ? 0 : INVERS));
if (attr) {
if ((event==EVT_KEY_FIRST(KEY_MENU)) || p1valdiff) {
killEvents(event);
@@ -2840,13 +2839,13 @@ void menuProcTelemetry(uint8_t event)
case ITEM_TELEMETRY_A2_LABEL:
lcd_putsLeft(y, STR_ACHANNEL);
lcd_outdezAtt(2*FW, y, ch+1, 0);
putsTelemetryChannel(TELEM_COL2+6*FW, y, ch+MAX_TIMERS, frskyData.analog[ch].value, LEFT);
putsTelemetryChannel(TELEM_COL2+6*FW, y, TELEM_A1-1+ch, frskyData.analog[ch].value, LEFT);
break;
case ITEM_TELEMETRY_A1_RANGE:
case ITEM_TELEMETRY_A2_RANGE:
lcd_puts(4, y, STR_RANGE);
putsTelemetryChannel(TELEM_COL2, y, ch+MAX_TIMERS, 255-channel.offset, ((attr && m_posHorz==0) ? blink : 0)|NO_UNIT|LEFT);
putsTelemetryChannel(TELEM_COL2, y, TELEM_A1-1+ch, 255-channel.offset, ((attr && m_posHorz==0) ? blink : 0)|NO_UNIT|LEFT);
lcd_putsiAtt(lcdLastPos, y, STR_VTELEMUNIT, channel.type, (attr && m_posHorz==1 ? blink : 0));
if (attr && (s_editMode>0 || p1valdiff)) {
if (m_posHorz == 0) {
@@ -2872,7 +2871,7 @@ void menuProcTelemetry(uint8_t event)
case ITEM_TELEMETRY_A1_OFFSET:
case ITEM_TELEMETRY_A2_OFFSET:
lcd_puts(4, y, STR_OFFSET);
putsTelemetryChannel(TELEM_COL2, y, ch+MAX_TIMERS, 0, LEFT|attr);
putsTelemetryChannel(TELEM_COL2, y, TELEM_A1-1+ch, 0, LEFT|attr);
if (attr) channel.offset = checkIncDec(event, channel.offset, -256, 256, EE_MODEL);
break;
@@ -2885,7 +2884,7 @@ void menuProcTelemetry(uint8_t event)
lcd_puts(4, y, STR_ALARM);
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ALARM_LEVEL(ch, j), (attr && m_posHorz==0) ? blink : 0);
lcd_putsiAtt(TELEM_COL2+4*FW, y, STR_VALARMFN, ALARM_GREATER(ch, j), (attr && m_posHorz==1) ? blink : 0);
putsTelemetryChannel(TELEM_COL2+6*FW, y, ch+MAX_TIMERS, channel.alarms_value[j], (attr && m_posHorz==2 ? blink : 0) | LEFT);
putsTelemetryChannel(TELEM_COL2+6*FW, y, TELEM_A1-1+ch, channel.alarms_value[j], (attr && m_posHorz==2 ? blink : 0) | LEFT);
if (attr && (s_editMode>0 || p1valdiff)) {
uint8_t t;
+1 -2
View File
@@ -227,7 +227,6 @@ inline void applyDefaultTemplate()
md->destCh = i;
md->weight = 100;
md->srcRaw = channel_order(i+1);
md->phases = 1;
}
STORE_MODELVARS;
@@ -2024,7 +2023,7 @@ void perOut(uint8_t tick10ms)
if (md->srcRaw==0) break;
if (!(md->phases & (1<<s_perout_flight_phase))) continue;
if (md->phases & (1<<s_perout_flight_phase)) continue;
//========== SWITCH ===============
bool sw = getSwitch(md->swtch, 1);
-1
View File
@@ -81,7 +81,6 @@ MixData* setDest(uint8_t dch, uint8_t src, bool clear=false)
mix->destCh = dch;
mix->srcRaw = src;
mix->weight = 100;
mix->phases = 1;
return mix;
}