Spectrum analyser fixes
Compatibily issue when telemetry comes from int + ext modules
This commit is contained in:
@@ -263,7 +263,7 @@ void setupPulsesInternalModule(uint8_t protocol)
|
||||
#if defined(PXX2)
|
||||
case PROTOCOL_CHANNELS_PXX2:
|
||||
intmodulePulsesData.pxx2.setupFrame(INTERNAL_MODULE);
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, moduleState[INTERNAL_MODULE].mode == MODULE_MODE_SPECTRUM_ANALYSER || moduleState[INTERNAL_MODULE].mode == MODULE_MODE_POWER_METER ? 1 : PXX2_PERIOD);
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, moduleState[INTERNAL_MODULE].mode == MODULE_MODE_SPECTRUM_ANALYSER || moduleState[INTERNAL_MODULE].mode == MODULE_MODE_POWER_METER ? PXX2_TOOLS_PERIOD : PXX2_PERIOD);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#define PXX2_ON_SPORT_BAUDRATE 230400
|
||||
#define PXX2_PERIOD 4 // 4ms
|
||||
#define PXX2_TOOLS_PERIOD 1 // 1ms
|
||||
#define PXX2_FRAME_MAXLENGTH 64
|
||||
|
||||
#define PXX_PULSES_PERIOD 9/*ms*/
|
||||
|
||||
@@ -267,13 +267,6 @@ void Pxx2Pulses::setupResetFrame(uint8_t module)
|
||||
|
||||
void Pxx2Pulses::setupSpectrumAnalyser(uint8_t module)
|
||||
{
|
||||
if (moduleState[module].counter > 1000) {
|
||||
moduleState[module].counter = 1002;
|
||||
return;
|
||||
}
|
||||
|
||||
moduleState[module].counter = 1002;
|
||||
|
||||
addFrameType(PXX2_TYPE_C_POWER_METER, PXX2_TYPE_ID_SPECTRUM);
|
||||
Pxx2Transport::addByte(0x00);
|
||||
Pxx2Transport::addWord(reusableBuffer.spectrumAnalyser.freq);
|
||||
@@ -283,16 +276,8 @@ void Pxx2Pulses::setupSpectrumAnalyser(uint8_t module)
|
||||
|
||||
void Pxx2Pulses::setupPowerMeter(uint8_t module)
|
||||
{
|
||||
if (moduleState[module].counter > 1000) {
|
||||
moduleState[module].counter = 1002;
|
||||
return;
|
||||
}
|
||||
|
||||
moduleState[module].counter = 1002;
|
||||
|
||||
addFrameType(PXX2_TYPE_C_POWER_METER, PXX2_TYPE_ID_POWER_METER);
|
||||
Pxx2Transport::addByte(0x00);
|
||||
|
||||
Pxx2Transport::addWord(reusableBuffer.powerMeter.freq);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user