feat: Configurable external CRSF baud rates (see #1581)
CRSF modules baudrate
This commit is contained in:
@@ -144,7 +144,7 @@ static void* crossfireInitInternal(uint8_t module)
|
||||
|
||||
// serial port setup
|
||||
etx_serial_init params(intmoduleCrossfireInitParams);
|
||||
params.baudrate = CROSSFIRE_BAUDRATE;
|
||||
params.baudrate = INT_CROSSFIRE_BAUDRATE;
|
||||
|
||||
// wakeup mixer when rx buffer is quarter full (16 bytes)
|
||||
params.on_receive = intmoduleCRSF_rx;
|
||||
|
||||
@@ -225,6 +225,11 @@ inline bool isModuleCrossfire(uint8_t idx)
|
||||
{
|
||||
return g_model.moduleData[idx].type == MODULE_TYPE_CROSSFIRE;
|
||||
}
|
||||
|
||||
inline bool isInternalModuleCrossfire()
|
||||
{
|
||||
return g_eeGeneral.internalModule == MODULE_TYPE_CROSSFIRE;
|
||||
}
|
||||
#else
|
||||
inline bool isModuleCrossfire(uint8_t idx)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -254,6 +254,8 @@ 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);
|
||||
#if defined(AFHDS3)
|
||||
|
||||
Reference in New Issue
Block a user