1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +03:00

Simu compilation fix

This commit is contained in:
Bertrand Songis 2016-04-10 13:42:55 +02:00
parent dd2ff29601
commit 7247a511cf
2 changed files with 40 additions and 48 deletions

View file

@ -1543,14 +1543,6 @@ extern union ReusableBuffer reusableBuffer;
void checkFlashOnBeep();
#if defined(CPUARM)
void putsValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags att);
#elif defined(FRSKY)
void convertUnit(getvalue_t & val, uint8_t & unit); // TODO check FORCEINLINE on stock
#else
#define convertUnit(...)
#endif
#if defined(CPUARM)
uint8_t zlen(const char *str, uint8_t size);
bool zexist(const char *str, uint8_t size);
@ -1701,6 +1693,46 @@ void varioWakeup();
#define IS_IMPERIAL_ENABLE() (0)
#endif
#if defined(CPUARM)
void putsValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags att);
#elif defined(FRSKY)
FORCEINLINE void convertUnit(getvalue_t & val, uint8_t & unit)
{
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_TEMPERATURE) {
val += 18;
val *= 115;
val >>= 6;
}
if (unit == UNIT_DIST) {
// m to ft *105/32
val = val * 3 + (val >> 2) + (val >> 5);
}
if (unit == UNIT_FEET) {
unit = UNIT_DIST;
}
if (unit == UNIT_KTS) {
// kts to mph
unit = UNIT_SPEED;
val = (val * 23) / 20;
}
}
else {
if (unit == UNIT_KTS) {
// kts to km/h
unit = UNIT_SPEED;
val = (val * 50) / 27;
}
}
if (unit == UNIT_HDG) {
unit = UNIT_TEMPERATURE;
}
}
#else
#define convertUnit(...)
#endif
#if !defined(CPUARM)
#define IS_USR_PROTO_FRSKY_HUB() (g_model.frsky.usrProto == USR_PROTO_FRSKY)
#define IS_USR_PROTO_WS_HOW_HIGH() (g_model.frsky.usrProto == USR_PROTO_WS_HOW_HIGH)