Bsongis/gui refactoring for x7 d (#3701)

* [X7D] New board added
* Cosmetics
This commit is contained in:
Bertrand Songis
2016-08-18 11:49:16 +02:00
committed by GitHub
parent 282b856309
commit d3ae3c035d
233 changed files with 7472 additions and 4560 deletions
+4 -4
View File
@@ -30,9 +30,9 @@ void setupPulsesPPM(uint8_t port, PpmPulsesData<T> * ppmPulsesData)
// The pulse ISR is 2mhz that's why everything is multiplied by 2
uint32_t firstCh = g_model.moduleData[port].channelsStart;
uint32_t lastCh = min<unsigned int>(NUM_CHNOUT, firstCh + 8 + g_model.moduleData[port].channelsCount);
uint32_t lastCh = min<unsigned int>(MAX_OUTPUT_CHANNELS, firstCh + 8 + g_model.moduleData[port].channelsCount);
#if defined(CPUSTM32)
#if defined(STM32)
ppmPulsesData->ptr = ppmPulsesData->pulses;
#else
uint16_t * ptr = ppmPulsesData->pulses;
@@ -44,14 +44,14 @@ void setupPulsesPPM(uint8_t port, PpmPulsesData<T> * ppmPulsesData)
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(CPUSTM32)
#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(CPUSTM32)
#if defined(STM32)
*ppmPulsesData->ptr++ = rest;
#else
*ptr = rest;