From fc1349fb75e35aaebab6ac864cdcd83a3ad72272 Mon Sep 17 00:00:00 2001 From: "bsongis@gmail.com" Date: Fri, 7 Jun 2013 15:29:53 +0000 Subject: [PATCH] [all] Nasty copy/paste bug on Radio Timer (inactivity alarm raises far too quickly!) [Taranis] Bad display of selected lines over bitmaps in MODELSEL screen --- src/gui/menu_model.cpp | 12 +++++++++--- src/opentx.cpp | 14 +++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gui/menu_model.cpp b/src/gui/menu_model.cpp index bbc01babb..e42a62f8e 100644 --- a/src/gui/menu_model.cpp +++ b/src/gui/menu_model.cpp @@ -315,6 +315,12 @@ void onModelSelectMenu(const char *result) } #endif +#if defined(PCBTARANIS) + #define MODELSEL_W 133 +#else + #define MODELSEL_W LCD_W +#endif + void menuModelSelect(uint8_t event) { if (s_warning_result) { @@ -589,7 +595,7 @@ void menuModelSelect(uint8_t event) if (k == sub) { if (s_copyMode == COPY_MODE) { k = s_copySrcRow; - lcd_putc(LCD_W-FW, y, '+'); + lcd_putc(MODELSEL_W-FW, y, '+'); } else { k = sub + s_copyTgtOfs; @@ -619,8 +625,8 @@ void menuModelSelect(uint8_t event) } if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) { - lcd_filled_rect(9, y, LCD_W-1-9, 7); - lcd_rect(8, y-1, LCD_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED); + lcd_filled_rect(9, y, MODELSEL_W-1-9, 7); + lcd_rect(8, y-1, MODELSEL_W-1-7, 9, s_copyMode == COPY_MODE ? SOLID : DOTTED); } } diff --git a/src/opentx.cpp b/src/opentx.cpp index 4d2253948..c1c6477a0 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -2101,7 +2101,7 @@ TimerState timersStates[MAX_TIMERS] = { { 0 }, { 0 } }; #if defined(THRTRACE) uint8_t s_traceBuf[MAXTRACE]; uint8_t s_traceWr; -int8_t s_traceCnt; +int s_traceCnt; #endif #if defined(HELI) || defined(FRSKY_HUB) @@ -3334,9 +3334,9 @@ void doMixerCalculations() } } //endfor timer loop (only two) - static tmr10ms_t s_cnt_100ms; - static uint8_t s_cnt_1s; - static uint8_t s_cnt_samples_thr_1s; + static uint8_t s_cnt_100ms; + static uint8_t s_cnt_1s; + static uint8_t s_cnt_samples_thr_1s; static uint16_t s_sum_samples_thr_1s; #if defined(THRTRACE) static uint8_t s_cnt_10s; @@ -3347,8 +3347,8 @@ void doMixerCalculations() s_cnt_samples_thr_1s++; s_sum_samples_thr_1s+=val; - if ((tmr10ms_t)(tmr10ms - s_cnt_100ms) >= 10) { // 0.1sec - s_cnt_100ms += 10; + if ((s_cnt_100ms += tick10ms) >= 10) { // 0.1sec + s_cnt_100ms -= 10; s_cnt_1s += 1; for (uint8_t i=0; i= 10) { // 10s - s_cnt_1s -= 10; + s_cnt_10s -= 10; val = s_sum_samples_thr_10s / s_cnt_samples_thr_10s; s_sum_samples_thr_10s = 0; s_cnt_samples_thr_10s = 0;