diff --git a/src/lcd.cpp b/src/lcd.cpp index c73813577..34f9ed90c 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -229,7 +229,7 @@ void lcd_outdez8(uint8_t x, uint8_t y, int8_t val) lcd_outdezAtt(x, y, val); } -void lcd_outdezAtt(uint8_t x, uint8_t y, int16_t val, uint8_t flags) +void lcd_outdezAtt(uint8_t x, uint8_t y, int16_t val, LcdFlags flags) { lcd_outdezNAtt(x, y, val, flags); } @@ -247,7 +247,7 @@ USAGE: LEADING0 means pad 0 to the left of sig. digits up to 'len' total characters */ -void lcd_outdezNAtt(uint8_t x, uint8_t y, int16_t val, uint8_t flags, uint8_t len) +void lcd_outdezNAtt(uint8_t x, uint8_t y, int16_t val, LcdFlags flags, uint8_t len) { uint8_t fw = FWNUM; int8_t mode = MODE(flags); @@ -331,8 +331,7 @@ void lcd_outdezNAtt(uint8_t x, uint8_t y, int16_t val, uint8_t flags, uint8_t le if (neg) lcd_putcAtt(x, y, '-', flags); #if defined(ROTARY_ENCODERS) - // TODO review it! - if (flags & BOLD) { + if (flags & SURROUNDED) { xn = lcdLastPos - x + 2; if (!neg) { x+=FW; xn-=FW; } lcd_rect(x-1, y-1, xn, 9, BLINK_ON_PHASE ? DOTTED : ~DOTTED); diff --git a/src/lcd.h b/src/lcd.h index 923cffe6a..046d55ba5 100644 --- a/src/lcd.h +++ b/src/lcd.h @@ -79,6 +79,16 @@ /* telemetry flags */ #define NO_UNIT 0x40 +#define SURROUNDED 0x100 + +#if defined(PCBARM) +#define LcdFlags uint32_t +#elif defined(PCBV4) +#define LcdFlags uint16_t +#else +#define LcdFlags uint8_t +#endif + extern uint8_t displayBuf[DISPLAY_W*DISPLAY_H/8]; extern uint8_t lcdLastPos; @@ -99,8 +109,8 @@ extern void lcd_putsn(uint8_t x,uint8_t y,const pm_char * s,unsigned char len); extern void lcd_outhex4(uint8_t x,uint8_t y,uint16_t val); -extern void lcd_outdezAtt(uint8_t x, uint8_t y, int16_t val, uint8_t mode=0); -extern void lcd_outdezNAtt(uint8_t x, uint8_t y, int16_t val, uint8_t mode=0, uint8_t len=0); +extern void lcd_outdezAtt(uint8_t x, uint8_t y, int16_t val, LcdFlags mode=0); +extern void lcd_outdezNAtt(uint8_t x, uint8_t y, int16_t val, LcdFlags mode=0, uint8_t len=0); extern void lcd_outdez8(uint8_t x, uint8_t y, int8_t val); extern void putsStrIdx(uint8_t x, uint8_t y, const pm_char *str, uint8_t idx, uint8_t att=0); diff --git a/src/menus.h b/src/menus.h index f1984c42e..d88982981 100644 --- a/src/menus.h +++ b/src/menus.h @@ -128,7 +128,7 @@ extern int8_t s_inflight_max; extern int8_t s_inflight_shift; extern uint8_t s_inflight_bitshift; #define PREPARE_INFLIGHT_BITFIELD(a) int8_t *bitfield = (a) -#define INFLIGHT(val) (s_inflight_value==&val ? BOLD : 0) +#define INFLIGHT(val) (s_inflight_value==&val ? SURROUNDED : 0) void checkInFlightIncDecModel(uint8_t event, int8_t *value, int8_t i_min, int8_t i_max, int8_t i_shift, const pm_char *label, uint8_t bitshift=0); #define CHECK_INFLIGHT_INCDEC_MODELVAR(event, var, imin, imax, ishift, label) \ checkInFlightIncDecModel(event, &var, imin, imax, ishift, label) diff --git a/src/open9x.cpp b/src/open9x.cpp index 0505e0535..c4b8388db 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1684,6 +1684,8 @@ void evalFunctions() { assert((int)(sizeof(activeFunctions)*8) > (int)(FUNC_MAX-NUM_CHNOUT)); + uint16_t newActiveFunctions = 0; + for (uint8_t i=0; ifunc == FUNC_TEST) { - printf("%d ", sd->swtch); + else if (sd->func == FUNC_TEST) { testFunc(); } #endif } - activeFunctions |= function_mask; + newActiveFunctions |= function_mask; active_switches |= switch_mask; } else { - activeFunctions &= (~function_mask); active_switches &= (~switch_mask); } } } + + activeFunctions = newActiveFunctions; } uint8_t s_perout_flight_phase;