Remove SKY9X target
This commit is contained in:
committed by
Peter Feerick
parent
5601bd53b2
commit
09c49e24ee
@@ -33,32 +33,18 @@ void setupPulsesPPM(PpmPulsesData<T> * ppmPulsesData, uint8_t channelsStart, int
|
||||
uint8_t firstCh = channelsStart;
|
||||
uint8_t lastCh = min<uint8_t>(MAX_OUTPUT_CHANNELS, firstCh + 8 + channelsCount);
|
||||
|
||||
#if defined(STM32)
|
||||
ppmPulsesData->ptr = ppmPulsesData->pulses;
|
||||
#else
|
||||
uint16_t * ptr = ppmPulsesData->pulses;
|
||||
ppmPulsesData->ptr = ptr;
|
||||
#endif
|
||||
|
||||
int32_t rest = 22500u * 2;
|
||||
rest += int32_t(frameLength) * 1000;
|
||||
for (uint32_t i=firstCh; i<lastCh; i++) {
|
||||
int16_t v = limit((int16_t)-PPM_range, channelOutputs[i], (int16_t)PPM_range) + 2*PPM_CH_CENTER(i);
|
||||
rest -= v;
|
||||
#if defined(STM32)
|
||||
*ppmPulsesData->ptr++ = v; /* as Pat MacKenzie suggests */
|
||||
#else
|
||||
*ptr++ = v; /* as Pat MacKenzie suggests */
|
||||
#endif
|
||||
}
|
||||
rest = limit<int32_t>(9000, rest, 65535); /* avoids that CCR2 is bigger than ARR which would cause reboot */
|
||||
#if defined(STM32)
|
||||
*ppmPulsesData->ptr++ = rest;
|
||||
*ppmPulsesData->ptr = 0; // it's needed in case PPM is sent without DMA (we stop when we reach this 0)
|
||||
#else
|
||||
*ptr = rest;
|
||||
*(ptr + 1) = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setupPulsesPPMTrainer()
|
||||
|
||||
Reference in New Issue
Block a user