mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 06:45:10 +03:00
Re #1458 - the cast is back, but cast to different type depending on platform. Gtest modernized.
This commit is contained in:
parent
ed094f89e8
commit
7130e48089
3 changed files with 10 additions and 20 deletions
|
@ -276,11 +276,7 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
|||
|
||||
if (mode != MODE(LEADING0)) {
|
||||
len = 1;
|
||||
#if defined(CPUARM)
|
||||
uint32_t tmp = ((uint32_t)val) / 10;
|
||||
#else
|
||||
uint16_t tmp = ((uint16_t)val) / 10;
|
||||
#endif
|
||||
lcduint_t tmp = ((lcduint_t)val) / 10;
|
||||
while (tmp) {
|
||||
len++;
|
||||
tmp /= 10;
|
||||
|
@ -324,13 +320,13 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
|||
if (dblsize) x++;
|
||||
|
||||
for (uint8_t i=1; i<=len; i++) {
|
||||
div_t qr = div(val, 10);
|
||||
div_t qr = div((lcduint_t)val, 10);
|
||||
char c = qr.rem + '0';
|
||||
LcdFlags f = flags;
|
||||
#if !defined(PCBTARANIS)
|
||||
if (dblsize) {
|
||||
if (c=='1' && i==len && xn>x+10) { x+=1; }
|
||||
if (val >= 1000) { x+=FWNUM; f&=~DBLSIZE; }
|
||||
if ((lcduint_t)val >= 1000) { x+=FWNUM; f&=~DBLSIZE; }
|
||||
}
|
||||
#endif
|
||||
lcd_putcAtt(x, y, c, f);
|
||||
|
@ -379,7 +375,7 @@ void lcd_outdezNAtt(xcoord_t x, uint8_t y, lcdint_t val, LcdFlags flags, uint8_t
|
|||
}
|
||||
}
|
||||
#if !defined(PCBTARANIS)
|
||||
if (dblsize && val >= 1000 && val < 10000) x-=2;
|
||||
if (dblsize && (lcduint_t)val >= 1000 && (lcduint_t)val < 10000) x-=2;
|
||||
#endif
|
||||
val = qr.quot;
|
||||
x -= fw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue