From 945ad2e7bd58527c9244629a73e241576c940b26 Mon Sep 17 00:00:00 2001 From: Tomer Abramovich Date: Thu, 23 Jan 2020 22:29:57 +0200 Subject: [PATCH] now using FrSkyX_scaleForPXX to scale channel values for FrSky R9 instead of using floating point math --- Multiprotocol/FrSkyR9_sx1276.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/FrSkyR9_sx1276.ino b/Multiprotocol/FrSkyR9_sx1276.ino index 04b447b..177ff90 100644 --- a/Multiprotocol/FrSkyR9_sx1276.ino +++ b/Multiprotocol/FrSkyR9_sx1276.ino @@ -174,8 +174,11 @@ uint16_t FrSkyR9_callback() for(int i = 0; i < 8; i += 3) { // map channel values (0-2047) to (64-1984) - uint16_t ch1 = 64 + (uint16_t)((1920.0f / 2047.0f) * Channel_data[chan_index]); - uint16_t ch2 = 64 + (uint16_t)((1920.0f / 2047.0f) * Channel_data[chan_index + 1]); + //uint16_t ch1 = 64 + (uint16_t)((1920.0f / 2047.0f) * Channel_data[chan_index]); + //uint16_t ch2 = 64 + (uint16_t)((1920.0f / 2047.0f) * Channel_data[chan_index + 1]); + + uint16_t ch1 = FrSkyX_scaleForPXX(chan_index); + uint16_t ch2 = FrSkyX_scaleForPXX(chan_index + 1); chan_index += 2;