Issue 189 done (will be there only on ARM as we need 32bits calculations almost everywhere)

This commit is contained in:
bsongis
2013-02-03 21:31:17 +00:00
parent 2163c7a1fe
commit cf54d94f08
6 changed files with 31 additions and 10 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ uint16_t getChannelRatio(uint8_t channel)
return (uint16_t)g_model.frsky.channels[channel].ratio << g_model.frsky.channels[channel].multiplier;
}
int16_t applyChannelRatio(uint8_t channel, int16_t val)
telvalue_t applyChannelRatio(uint8_t channel, telvalue_t val)
{
return ((int32_t)val+g_model.frsky.channels[channel].offset) * getChannelRatio(channel) * 2 / 51;
}
@@ -1045,7 +1045,7 @@ const pm_uint8_t bchunit_ar[] PROGMEM = {
UNIT_METERS, // GPS Alt
};
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att)
void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, telvalue_t val, uint8_t att)
{
switch (channel) {
case TELEM_TM1-1:
@@ -1061,7 +1061,7 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
channel -= TELEM_A1-1;
// A1 and A2
{
int16_t converted_value = applyChannelRatio(channel, val);
telvalue_t converted_value = applyChannelRatio(channel, val);
if (g_model.frsky.channels[channel].type >= UNIT_RAW) {
converted_value /= 10;
}