The sticky key bug reported by Rob!

SURROUNDED again here (for Rotary Encoder parameters inflight modification)
This commit is contained in:
bsongis
2012-07-11 17:38:22 +00:00
parent 95170b5930
commit 955767669e
4 changed files with 22 additions and 11 deletions
+3 -4
View File
@@ -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);
+12 -2
View File
@@ -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);
+1 -1
View File
@@ -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)
+6 -4
View File
@@ -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; i<NUM_CHNOUT; i++)
safetyCh[i] = -128; // not defined
@@ -1783,22 +1785,22 @@ void evalFunctions()
#endif
#if defined(DEBUG)
if (sd->func == 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;