From 830d1ffd905e544fb0a0e39644a2b8e741fe09ea Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 13 May 2012 18:10:10 +0000 Subject: [PATCH] Revert the latest flash saving. Was wrong. --- src/model_menus.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/model_menus.cpp b/src/model_menus.cpp index 23683f323..7b010bef1 100644 --- a/src/model_menus.cpp +++ b/src/model_menus.cpp @@ -1757,19 +1757,18 @@ 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; - int8_t k = cur - s_pgOfs; if (expo ? (ichn+1 == ch && ed->mode) : (isrcRaw && md->destCh+1 == ch)) { - if (k > 0 && k < 8) { + if (s_pgOfs < cur && cur-s_pgOfs < 8) { if (expo) - putsChnRaw(0, k*FH, ch, 0); + putsChnRaw(0, (cur-s_pgOfs)*FH, ch, 0); else - putsChn(0, k*FH, ch, 0); // show CHx + putsChn(0, (cur-s_pgOfs)*FH, ch, 0); // show CHx } uint8_t mixCnt = 0; do { if (s_copyMode) { - if (s_copyMode == MOVE_MODE && k > 0 && k < 8 && s_copySrcCh == ch && s_copyTgtOfs != 0 && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { - uint8_t y = k*FH; + if (s_copyMode == MOVE_MODE && s_pgOfs < cur && cur-s_pgOfs < 8 && s_copySrcCh == ch && s_copyTgtOfs != 0 && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { + uint8_t y = (cur-s_pgOfs)*FH; lcd_rect(expo ? 18 : 22, y-1, expo ? DISPLAY_W-18 : DISPLAY_W-22, 9, DOTTED); cur++; } @@ -1781,7 +1780,7 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_) else if (sub == cur) { s_currIdx = i; } - if (k > 0 && k < 8) { + if (s_pgOfs < cur && cur-s_pgOfs < 8) { if (expo) displayExpoLine(cur, i, ch, mixCnt, sub, _event); else @@ -1789,8 +1788,8 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_) } cur++; mixCnt++; i++; md++; ed++; } while (expo ? (ichn+1 == ch && ed->mode) : (isrcRaw && md->destCh+1 == ch)); - if (s_copyMode == MOVE_MODE && k > 0 && k < 8 && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) { - uint8_t y = k*FH; + 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(expo ? 18 : 22, y-1, expo ? DISPLAY_W-18 : DISPLAY_W-22, 9, DOTTED); cur++; } @@ -1804,13 +1803,13 @@ void menuProcExpoMix(uint8_t expo, uint8_t _event_) attr = INVERS; } } - if (k > 0 && k < 8) { + if (s_pgOfs < cur && cur-s_pgOfs < 8) { if (expo) - putsChnRaw(0, k*FH, ch, attr); + putsChnRaw(0, (cur-s_pgOfs)*FH, ch, attr); else - putsChn(0, k*FH, ch, attr); // show CHx + putsChn(0, (cur-s_pgOfs)*FH, ch, attr); // show CHx if (s_copyMode == MOVE_MODE && s_copySrcCh == ch) { - uint8_t y = k*FH; + uint8_t y = (cur-s_pgOfs)*FH; lcd_rect(expo ? 18 : 22, y-1, expo ? (DISPLAY_W-18) : (DISPLAY_W-22), 9, DOTTED); } }