Remove SKY9X target

This commit is contained in:
Raphael Coeffic
2022-01-29 14:40:17 +10:00
committed by Peter Feerick
parent 5601bd53b2
commit 09c49e24ee
166 changed files with 24 additions and 38415 deletions
-19
View File
@@ -24,9 +24,6 @@
#define DSM2_SEND_BIND (1 << 7)
#define DSM2_SEND_RANGECHECK (1 << 5)
#if defined(PCBSKY9X)
uint8_t dsm2BindTimer = DSM2_BIND_TIMEOUT;
#endif
// DSM2 control bits
#define DSM2_CHANS 6
@@ -135,28 +132,12 @@ void setupPulsesDSM2()
break;
}
#if defined(PCBSKY9X)
if (dsm2BindTimer > 0) {
dsm2BindTimer--;
if (switchState(SW_DSM2_BIND)) {
moduleState[EXTERNAL_MODULE].mode = MODULE_MODE_BIND;
dsmDat[0] |= DSM2_SEND_BIND;
}
}
else if (moduleState[EXTERNAL_MODULE].mode == MODULE_MODE_RANGECHECK) {
dsmDat[0] |= DSM2_SEND_RANGECHECK;
}
else {
moduleState[EXTERNAL_MODULE].mode = 0;
}
#else
if (moduleState[EXTERNAL_MODULE].mode == MODULE_MODE_BIND) {
dsmDat[0] |= DSM2_SEND_BIND;
}
else if (moduleState[EXTERNAL_MODULE].mode == MODULE_MODE_RANGECHECK) {
dsmDat[0] |= DSM2_SEND_RANGECHECK;
}
#endif
dsmDat[1] = g_model.header.modelId[EXTERNAL_MODULE]; // DSM2 Header second byte for model match
-11
View File
@@ -244,17 +244,10 @@ inline bool isModuleGhost(uint8_t idx)
}
#endif
#if defined(PCBSKY9X)
inline bool isExtraModule(uint8_t idx)
{
return idx == EXTRA_MODULE;
}
#else
inline bool isExtraModule(uint8_t)
{
return false;
}
#endif
inline bool isModuleTypePPM(uint8_t type)
{
@@ -263,10 +256,6 @@ inline bool isModuleTypePPM(uint8_t type)
inline bool isModulePPM(uint8_t moduleIdx)
{
#if defined(PCBSKY9X)
if (moduleIdx == EXTRA_MODULE)
return true;
#endif
return isModuleTypePPM(g_model.moduleData[moduleIdx].type);
}
-14
View File
@@ -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()
-12
View File
@@ -296,12 +296,8 @@ void enablePulsesExternalModule(uint8_t protocol)
case PROTOCOL_CHANNELS_DSM2_LP45:
case PROTOCOL_CHANNELS_DSM2_DSM2:
case PROTOCOL_CHANNELS_DSM2_DSMX:
#if defined(PCBSKY9X)
extmoduleSerialStart(DSM2_BAUDRATE, DSM2_PERIOD * 2000, false);
#else
extmoduleSerialStart();
mixerSchedulerSetPeriod(EXTERNAL_MODULE, DSM2_PERIOD);
#endif
break;
#endif
@@ -333,12 +329,8 @@ void enablePulsesExternalModule(uint8_t protocol)
#if defined(MULTIMODULE)
case PROTOCOL_CHANNELS_MULTIMODULE:
#if defined(PCBSKY9X)
extmoduleSerialStart(MULTIMODULE_BAUDRATE, MULTIMODULE_PERIOD * 2000, true);
#else
extmoduleSerialStart();
mixerSchedulerSetPeriod(EXTERNAL_MODULE, MULTIMODULE_PERIOD);
#endif
getMultiModuleStatus(EXTERNAL_MODULE).failsafeChecked = false;
getMultiModuleStatus(EXTERNAL_MODULE).flags = 0;
#if defined(MULTI_PROTOLIST)
@@ -349,12 +341,8 @@ void enablePulsesExternalModule(uint8_t protocol)
#if defined(SBUS)
case PROTOCOL_CHANNELS_SBUS:
#if defined(PCBSKY9X)
extmoduleSerialStart(SBUS_BAUDRATE, SBUS_PERIOD_HALF_US, false);
#else
extmoduleSerialStart();
mixerSchedulerSetPeriod(EXTERNAL_MODULE, SBUS_PERIOD);
#endif
break;
#endif
-4
View File
@@ -33,10 +33,6 @@
#include "modules_helpers.h"
#include "ff.h"
#if defined(PCBSKY9X) && defined(DSM2)
#define DSM2_BIND_TIMEOUT 255 // 255*11ms
extern uint8_t dsm2BindTimer;
#endif
#if defined(DSM2)
#define IS_DSM2_PROTOCOL(protocol) (protocol>=PROTOCOL_CHANNELS_DSM2_LP45 && protocol<=PROTOCOL_CHANNELS_DSM2_DSMX)