mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 16:28:10 +00:00
now using FrSkyX_scaleForPXX to scale channel values for FrSky R9 instead of using floating point math
This commit is contained in:
parent
6f9740f03f
commit
945ad2e7bd
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user