[X9D] We can avoid CONDENSED for values >1000 on X9D

This commit is contained in:
bernet.andre@gmail.com
2013-03-06 18:56:22 +00:00
parent fac0e5df5e
commit 204014c8c2
+4
View File
@@ -421,10 +421,12 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
div_t qr = div((uint16_t)val, 10); div_t qr = div((uint16_t)val, 10);
char c = qr.rem + '0'; char c = qr.rem + '0';
LcdFlags f = flags; LcdFlags f = flags;
#if !defined(PCBX9D)
if (dblsize) { if (dblsize) {
if (c=='1' && i==len && xn>x+10) { x+=2; f|=CONDENSED; } if (c=='1' && i==len && xn>x+10) { x+=2; f|=CONDENSED; }
if ((uint16_t)val >= 1000) { x+=FWNUM; f&=~DBLSIZE; } if ((uint16_t)val >= 1000) { x+=FWNUM; f&=~DBLSIZE; }
} }
#endif
lcd_putcAtt(x, y, c, f); lcd_putcAtt(x, y, c, f);
if (mode==i) { if (mode==i) {
flags &= ~PREC2; // TODO not needed but removes 20bytes, could be improved for sure, check asm flags &= ~PREC2; // TODO not needed but removes 20bytes, could be improved for sure, check asm
@@ -449,7 +451,9 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
x--; x--;
} }
} }
#if !defined(PCBX9D)
if (dblsize && (uint16_t)val >= 1000 && (uint16_t)val < 10000) x-=2; if (dblsize && (uint16_t)val >= 1000 && (uint16_t)val < 10000) x-=2;
#endif
val = qr.quot; val = qr.quot;
x-=fw; x-=fw;
} }