mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fixes #1458 - Incorrect display of free mem on statistics page
lcd_outdezNAtt() on ARM was casting values to uint16_t.
This commit is contained in:
parent
50122d4ee1
commit
ed094f89e8
1 changed files with 3 additions and 3 deletions
|
@ -324,13 +324,13 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||||
if (dblsize) x++;
|
if (dblsize) x++;
|
||||||
|
|
||||||
for (uint8_t i=1; i<=len; i++) {
|
for (uint8_t i=1; i<=len; i++) {
|
||||||
div_t qr = div((uint16_t)val, 10);
|
div_t qr = div(val, 10);
|
||||||
char c = qr.rem + '0';
|
char c = qr.rem + '0';
|
||||||
LcdFlags f = flags;
|
LcdFlags f = flags;
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
if (dblsize) {
|
if (dblsize) {
|
||||||
if (c=='1' && i==len && xn>x+10) { x+=1; }
|
if (c=='1' && i==len && xn>x+10) { x+=1; }
|
||||||
if ((uint16_t)val >= 1000) { x+=FWNUM; f&=~DBLSIZE; }
|
if (val >= 1000) { x+=FWNUM; f&=~DBLSIZE; }
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lcd_putcAtt(x, y, c, f);
|
lcd_putcAtt(x, y, c, f);
|
||||||
|
@ -379,7 +379,7 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !defined(PCBTARANIS)
|
#if !defined(PCBTARANIS)
|
||||||
if (dblsize && (uint16_t)val >= 1000 && (uint16_t)val < 10000) x-=2;
|
if (dblsize && val >= 1000 && val < 10000) x-=2;
|
||||||
#endif
|
#endif
|
||||||
val = qr.quot;
|
val = qr.quot;
|
||||||
x -= fw;
|
x -= fw;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue