From d83a755a21e31c0d83fbe1e031717c60ac495e6a Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 12 Mar 2012 17:08:23 +0000 Subject: [PATCH] Problem when deleting all mixes from a model --- src/model_menus.cpp | 6 +++--- src/open9x.h | 2 -- src/templates.cpp | 5 ----- src/templates.h | 5 ----- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index a8bee9509..6cb732159 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -985,7 +985,7 @@ void insertExpoMix(uint8_t expo, uint8_t idx) memmove(mix+1, mix, (MAX_MIXERS-(idx+1))*sizeof(MixData)); memset(mix,0,sizeof(MixData)); mix->destCh = s_currCh-1; - mix->srcRaw = s_currCh; + mix->srcRaw = (s_currCh > 4 ? s_currCh : channel_order(s_currCh)); mix->weight = 100; } STORE_MODELVARS; @@ -1475,7 +1475,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_) for (uint8_t ch=1; ch<=(expo ? NUM_STICKS : NUM_CHNOUT); ch++) { MixData *md=NULL; ExpoData *ed=NULL; - if (expo ? (ichn+1 == ch && ed->mode) : (idestCh+1 == ch)) { + if (expo ? (ichn+1 == ch && ed->mode) : (isrcRaw && md->destCh+1 == ch)) { if (s_pgOfs < cur && cur-s_pgOfs < 8) { if (expo) putsChnRaw(0, (cur-s_pgOfs)*FH, ch, 0); @@ -1505,7 +1505,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_) displayMixerLine(cur, i, ch, mixCnt, sub, _event); } cur++; mixCnt++; i++; md++; ed++; - } while (expo ? (ichn+1 == ch && ed->mode) : (idestCh+1 == ch)); + } while (expo ? (ichn+1 == ch && ed->mode) : (isrcRaw && md->destCh+1 == ch)); if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { uint8_t y = (cur-s_pgOfs)*FH; lcd_rect(22, y-1, DISPLAY_W-1-21, 9, DOTTED); diff --git a/src/open9x.h b/src/open9x.h index 2e056505b..86836c227 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -625,8 +625,6 @@ extern volatile uint8_t g_blinkTmr10ms; extern uint8_t g_beepCnt; extern uint8_t g_beepVal[5]; -extern const PROGMEM char modi12x3[]; - #include "o9xstrings.h" extern int16_t g_ppmIns[8]; diff --git a/src/templates.cpp b/src/templates.cpp index f294eb737..1b6ac53ae 100644 --- a/src/templates.cpp +++ b/src/templates.cpp @@ -49,11 +49,6 @@ * ELE->Flap * Flap->ELE * - * ============================================================= - * Assumptions: - * All primary channels are per modi12x3 - * Each template added to the end of each channel - * */ #include "open9x.h" diff --git a/src/templates.h b/src/templates.h index be56bb774..420588b08 100644 --- a/src/templates.h +++ b/src/templates.h @@ -48,11 +48,6 @@ * ELE->Flap * Flap->ELE * - * ============================================================= - * Assumptions: - * All primary channels are per modi12x3 - * Each template added to the end of each channel - * */ #ifndef TEMPLATES_H