Vario code moved to a separate file vario.cpp

This commit is contained in:
bsongis
2014-06-03 10:38:23 +02:00
parent df30dd9bb9
commit 4a099a7161
13 changed files with 236 additions and 195 deletions
+10
View File
@@ -144,6 +144,16 @@ void FrskyValueWithMinMax::set(uint8_t value, uint8_t unit)
}
}
uint16_t getChannelRatio(uint8_t channel)
{
return (uint16_t)g_model.frsky.channels[channel].ratio << g_model.frsky.channels[channel].multiplier;
}
lcdint_t applyChannelRatio(uint8_t channel, lcdint_t val)
{
return ((int32_t)val+g_model.frsky.channels[channel].offset) * getChannelRatio(channel) * 2 / 51;
}
#if defined(CPUARM)
inline bool rxBattAlarmRaised(uint8_t alarm)
{