Compilation fixes

This commit is contained in:
3djc
2022-03-21 11:48:49 +01:00
committed by Raphael Coeffic
parent e63eeb0984
commit c0e6f2a7f9
5 changed files with 44 additions and 22 deletions
+1 -1
View File
@@ -1060,7 +1060,7 @@ void menuModelSetup(event_t event)
}
break;
#if defined(HARDWARE_INTERNAL_MODULE) && (defined(CROSSFIRE) || defined(GHOST))
#if defined(HARDWARE_EXTERNAL_MODULE) && (defined(CROSSFIRE) || defined(GHOST))
case ITEM_MODEL_SETUP_EXTERNAL_MODULE_BAUDRATE: {
ModuleData & moduleData = g_model.moduleData[moduleIdx];
lcdDrawText(INDENT_WIDTH, y, STR_BAUDRATE);
-15
View File
@@ -247,21 +247,6 @@ class SerialConfigWindow : public FormGroup
}
};
void restartExternalModule()
{
if (!IS_EXTERNAL_MODULE_ON()) {
return;
}
pauseMixerCalculations();
pausePulses();
EXTERNAL_MODULE_OFF();
RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate
telemetryProtocol = 255; // force telemetry port + module reinitialization
EXTERNAL_MODULE_ON();
resumePulses();
resumeMixerCalculations();
}
class InternalModuleWindow : public FormGroup {
public:
InternalModuleWindow(FormWindow *parent, const rect_t &rect) :
@@ -101,9 +101,9 @@ enum {
ITEM_RADIO_HARDWARE_INTERNAL_MODULE_TYPE,
ITEM_RADIO_HARDWARE_INTERNAL_MODULE_BAUDRATE,
#endif
#if defined(HARDWARE_EXTERNAL_MODULE)
ITEM_RADIO_HARDWARE_SERIAL_SAMPLE_MODE,
#endif
#if defined(BLUETOOTH)
ITEM_RADIO_HARDWARE_BLUETOOTH_MODE,
ITEM_RADIO_HARDWARE_BLUETOOTH_PAIRING_CODE,
@@ -233,8 +233,11 @@ enum {
#else
#define INTERNAL_MODULE_ROWS
#endif
#if defined(HARDWARE_EXTERNAL_MODULE)
#define SERIAL_SAMPLE_MODE_ROWS 0,
#else
#define SERIAL_SAMPLE_MODE_ROWS
#endif
#if defined(AUX_SERIAL) || defined(USB_SERIAL)
static uint8_t _dispSerialPort(uint8_t port_nr)
@@ -536,19 +539,19 @@ void menuRadioHardware(event_t event)
if (attr) {
g_eeGeneral.InternalModuleBaudrate = CROSSFIRE_INDEX_TO_STORE(checkIncDecModel(event, CROSSFIRE_STORE_TO_INDEX(g_eeGeneral.InternalModuleBaudrate), 0, CROSSFIRE_MAX_INTERNAL_BAUDRATE));
if (checkIncDec_Ret) {
restartExternalModule();
restartInternalModule();
}
}
break;
#endif
#if defined(HARDWARE_EXTERNAL_MODULE)
case ITEM_RADIO_HARDWARE_SERIAL_SAMPLE_MODE:
g_eeGeneral.uartSampleMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_SAMPLE_MODE, STR_SAMPLE_MODES, g_eeGeneral.uartSampleMode, 0, UART_SAMPLE_MODE_MAX, attr, event);
if (attr && checkIncDec_Ret) {
restartExternalModule();
}
break;
#endif
#if defined(BLUETOOTH)
case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE:
lcdDrawTextAlignedLeft(y, STR_BLUETOOTH);
+33
View File
@@ -69,6 +69,39 @@ void ModuleState::startBind(BindInformation* destination,
#endif
}
#if defined(HARDWARE_INTERNAL_MODULE)
void restartInternalModule()
{
if (!IS_INTERNAL_MODULE_ON()) {
return;
}
pauseMixerCalculations();
pausePulses();
INTERNAL_MODULE_OFF();
RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate
telemetryProtocol = 255; // force telemetry port + module reinitialization
INTERNAL_MODULE_ON();
resumePulses();
resumeMixerCalculations();
}
#endif
#if defined(HARDWARE_EXTERNAL_MODULE)
void restartExternalModule()
{
if (!IS_EXTERNAL_MODULE_ON()) {
return;
}
pauseMixerCalculations();
pausePulses();
EXTERNAL_MODULE_OFF();
RTOS_WAIT_MS(20); // 20ms so that the pulses interrupt will reinit the frame rate
telemetryProtocol = 255; // force telemetry port + module reinitialization
EXTERNAL_MODULE_ON();
resumePulses();
resumeMixerCalculations();
}
#endif
void ModuleState::readModuleInformation(ModuleInformation* destination,
int8_t first, int8_t last)
{
+1
View File
@@ -254,6 +254,7 @@ void extmodulePxx1SerialStart();
void extmodulePpmStart();
void intmoduleStop();
void extmoduleStop();
void restartInternalModule();
void restartExternalModule();
void getModuleStatusString(uint8_t moduleIdx, char * statusText);
void getModuleSyncStatusString(uint8_t moduleIdx, char * statusText);