Multiplier added to FrSky telemetry A1/A2 ratio

Now it covers range 0V => 204.0V
This commit is contained in:
bsongis
2012-02-09 11:24:45 +00:00
parent a9ac3f2015
commit 11c8219f79
2 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -522,7 +522,7 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
// A1 and A2
{
// TODO optimize this, avoid int32_t
int16_t converted_value = ((int32_t)val+g_model.frsky.channels[channel].offset) * g_model.frsky.channels[channel].ratio * 2 / 51;
int16_t converted_value = ((int32_t)val+g_model.frsky.channels[channel].offset) * (g_model.frsky.channels[channel].ratio << g_model.frsky.channels[channel].multiplier) * 2 / 51;
if (g_model.frsky.channels[channel].type >= UNIT_RAW) {
converted_value /= 10;
}