Fix compilation with MULTIMODULE=NO

And allow for Spektrum telemetry to stay enabled (needed for DSMP module).
This commit is contained in:
Raphael Coeffic
2022-07-22 20:45:04 +10:00
committed by Peter Feerick
parent 59466b1978
commit 8379b47e2b
29 changed files with 204 additions and 58 deletions
+4
View File
@@ -27,6 +27,10 @@
#include "storage/modelslist.h"
#endif
#if defined(CROSSFIRE)
#include "telemetry/crossfire.h"
#endif
// TODO find why we need this (for REGISTER at least)
#if defined(PCBXLITE)
#define EVT_BUTTON_PRESSED() EVT_KEY_FIRST(KEY_ENTER)
+4
View File
@@ -22,6 +22,10 @@
#include "opentx.h"
#include "mixer_scheduler.h"
#if defined(CROSSFIRE)
#include "telemetry/crossfire.h"
#endif
uint8_t g_moduleIdx;
uint8_t getSwitchWarningsCount()
+8 -1
View File
@@ -22,6 +22,10 @@
#include "bind_menu_d16.h"
#include "opentx.h"
#if defined(MULTIMODULE)
#include "telemetry/multi.h"
#endif
BindChoiceMenu::BindChoiceMenu(Window *parent, uint8_t moduleIdx,
std::function<void()> onPress,
std::function<void()> onCancel) :
@@ -68,11 +72,14 @@ void BindChoiceMenu::onSelect(BindChanMode mode)
}
ModuleData* md = &g_model.moduleData[moduleIdx];
#if defined(MULTIMODULE)
if (isModuleMultimodule(moduleIdx)) {
md->multi.receiverTelemetryOff = !receiverTelemetry;
md->multi.receiverHigherChannels = receiverHigherChannels;
setMultiBindStatus(moduleIdx, MULTI_BIND_INITIATED);
} else {
} else
#endif
{
md->pxx.receiverTelemetryOff = !receiverTelemetry;
md->pxx.receiverHigherChannels = receiverHigherChannels;
}
@@ -24,6 +24,8 @@
#include "mixer_scheduler.h"
#include "telemetry/crossfire.h"
#define SET_DIRTY() storageDirty(EE_MODEL)
CrossfireSettings::CrossfireSettings(Window* parent, const FlexGridLayout& g,
+6
View File
@@ -22,6 +22,10 @@
#include "hw_intmodule.h"
#include "opentx.h"
#if defined(CROSSFIRE)
#include "telemetry/crossfire.h"
#endif
#define SET_DIRTY() storageDirty(EE_GENERAL)
static const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(3),
@@ -77,6 +81,7 @@ void InternalModuleWindow::setModuleType(int moduleType)
SET_DIRTY();
}
#if defined(CROSSFIRE)
int InternalModuleWindow::getBaudrate()
{
return CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.internalModuleBaudrate);
@@ -88,6 +93,7 @@ void InternalModuleWindow::setBaudrate(int val)
restartModule(INTERNAL_MODULE);
SET_DIRTY();
}
#endif
void InternalModuleWindow::updateBaudrateLine()
{
+2
View File
@@ -32,8 +32,10 @@ class InternalModuleWindow : public FormGroup::Line
uint8_t lastModule = 0;
lv_obj_t* br_box = nullptr;
#if defined(CROSSFIRE)
static int getBaudrate();
static void setBaudrate(int val);
#endif
void setModuleType(int moduleType);
void updateBaudrateLine();
+7 -1
View File
@@ -37,6 +37,7 @@
#endif
#if defined(CROSSFIRE)
#include "telemetry/crossfire.h"
#include "crossfire_settings.h"
#endif
@@ -196,9 +197,11 @@ void ModuleWindow::updateModule()
GET_DEFAULT(*modelId), [=](int32_t newValue) {
if (newValue != *modelId) {
*modelId = newValue;
#if defined(CROSSFIRE)
if (isModuleCrossfire(moduleIdx)) {
moduleState[moduleIdx].counter = CRSF_FRAME_MODELID;
}
#endif
SET_DIRTY();
}
});
@@ -566,6 +569,7 @@ void ModuleSubTypeChoice::update()
void ModuleSubTypeChoice::openMenu()
{
#if defined(MULTIMODULE)
if (isModuleMultimodule(moduleIdx)) {
auto menu = new Menu(this);
@@ -587,7 +591,9 @@ void ModuleSubTypeChoice::openMenu()
ModuleData* md = &g_model.moduleData[moduleIdx];
int idx = protos->getIndex(md->multi.rfProtocol);
if (idx >= 0) menu->select(idx);
} else {
} else
#endif
{
Choice::openMenu();
}
}
@@ -23,6 +23,9 @@
#include "radio_ghost_module_config.h"
#include "libopenui.h"
#include "telemetry/ghost.h"
#include "telemetry/ghost_menu.h"
class GhostModuleConfigWindow: public Window
{
public:
@@ -21,6 +21,10 @@
#include "opentx.h"
#if defined(GHOST)
#include "telemetry/ghost.h"
#endif
void menuGhostModuleConfig(event_t event)
{
switch (event) {
@@ -23,6 +23,10 @@
#include "hal/adc_driver.h"
#include "aux_serial_driver.h"
#if defined(CROSSFIRE)
#include "telemetry/crossfire.h"
#endif
#if defined(PCBTARANIS)
enum {
ITEM_RADIO_HARDWARE_LABEL_STICKS,