Merge branch 'master' into channel-processing-speedup

This commit is contained in:
Pawel Spychalski (DzikuVx)
2018-01-03 19:44:44 +01:00
7 changed files with 100 additions and 26 deletions

View File

@@ -93,11 +93,11 @@ void decodeRxHealthPayload(QspConfiguration_t *qsp, RxDeviceState_t *rxDeviceSta
/**
* Encode 10 RC channels
*/
void encodeRcDataPayload(QspConfiguration_t *qsp, PPMReader *ppmSource, uint8_t noOfChannels)
void encodeRcDataPayload(QspConfiguration_t *qsp, int channels[], uint8_t noOfChannels)
{
for (uint8_t i = 0; i < noOfChannels; i++)
{
int cV = constrain(ppmSource->get(i), 1000, 2000) - 1000;
int cV = constrain(channels[i], 1000, 2000) - 1000;
uint16_t channelValue10 = cV & 0x03ff;
uint8_t channelValue8 = (cV >> 2) & 0xff;