Support new Multi 1.3 features (#7077)

This commit is contained in:
3djc
2019-11-15 16:20:24 +01:00
committed by GitHub
parent 86b186fafd
commit 3a7e006635
57 changed files with 1542 additions and 355 deletions
@@ -39,7 +39,11 @@ coord_t getAverage(uint8_t number, const uint8_t * value)
return sum / number;
}
#define SPECTRUM_ROW (isModuleMultimodule(g_moduleIdx) ? READONLY_ROW : (uint8_t)0)
#if defined(INTERNAL_MODULE_MULTI)
#define SPECTRUM_ROW (g_moduleIdx == INTERNAL_MODULE ? READONLY_ROW : isModuleMultimodule(g_moduleIdx) ? READONLY_ROW : (uint8_t)0)
#else
#define SPECTRUM_ROW (isModuleMultimodule(g_moduleIdx) ? READONLY_ROW : (uint8_t)0)
#endif
bool menuRadioSpectrumAnalyser(event_t event)
{
@@ -54,8 +58,12 @@ bool menuRadioSpectrumAnalyser(event_t event)
lcdRefresh();
if (isModulePXX2(g_moduleIdx))
moduleState[g_moduleIdx].readModuleInformation(&reusableBuffer.moduleSetup.pxx2.moduleInformation, PXX2_HW_INFO_TX_ID, PXX2_HW_INFO_TX_ID);
else if (isModuleMultimodule((g_moduleIdx)))
moduleState[g_moduleIdx].mode = MODULE_MODE_NORMAL;
else if (isModuleMultimodule(g_moduleIdx)) {
if (reusableBuffer.spectrumAnalyser.moduleOFF)
setModuleType(INTERNAL_MODULE, MODULE_TYPE_NONE);
else
moduleState[g_moduleIdx].mode = MODULE_MODE_NORMAL;
}
/* wait 1s to resume normal operation before leaving */
watchdogSuspend(1000);
RTOS_WAIT_MS(1000);
@@ -71,9 +79,15 @@ bool menuRadioSpectrumAnalyser(event_t event)
}
return false;
}
memclear(&reusableBuffer.spectrumAnalyser, sizeof(reusableBuffer.spectrumAnalyser));
#if defined(INTERNAL_MODULE_MULTI)
if (g_moduleIdx == INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_NONE) {
reusableBuffer.spectrumAnalyser.moduleOFF = true;
setModuleType(INTERNAL_MODULE, MODULE_TYPE_MULTIMODULE);
}
#endif
if (isModuleR9MAccess(g_moduleIdx)) {
reusableBuffer.spectrumAnalyser.spanDefault = 20;
reusableBuffer.spectrumAnalyser.spanMax = 40;