From 3223b890ad15ce395a0508e20747efe933a4eb49 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 29 Aug 2012 15:18:32 +0000 Subject: [PATCH] Problem with d>ofs A1 [negative ofs] --- src/frsky.cpp | 2 +- src/frsky.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frsky.cpp b/src/frsky.cpp index 504e544c2..a63b06a17 100644 --- a/src/frsky.cpp +++ b/src/frsky.cpp @@ -140,7 +140,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, uint8_t val) +int16_t applyChannelRatio(uint8_t channel, int16_t val) { return ((int32_t)val+g_model.frsky.channels[channel].offset) * getChannelRatio(channel) * 2 / 51; } diff --git a/src/frsky.h b/src/frsky.h index 3977d6b6f..aef7abcb3 100644 --- a/src/frsky.h +++ b/src/frsky.h @@ -215,7 +215,7 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value); NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm); extern const pm_uint8_t bchunit_ar[]; -int16_t applyChannelRatio(uint8_t channel, uint8_t val); +int16_t applyChannelRatio(uint8_t channel, int16_t val); void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att); #endif