1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-924: Any disconnect between radios causes a reset, which causes a re-configuration of I/O devices (com ports, PPM, etc). This causes problems due to certain devices (PPM in particular) not supporting re-configuration. This patch forces configuration to only happen once (on initial connection), which should fix this issue.

This commit is contained in:
Brian Webb 2013-04-28 15:16:34 +01:00
parent 76e4638b8f
commit e642183dee

View File

@ -91,6 +91,9 @@ typedef struct {
// Should we parse UAVTalk?
bool parseUAVTalk;
// We can only configure the hardware once.
bool configured;
// The current configured uart speed
OPLinkSettingsComSpeedOptions comSpeed;
@ -232,6 +235,7 @@ static int32_t RadioComBridgeInitialize(void)
data->comTxRetries = 0;
data->UAVTalkErrors = 0;
data->parseUAVTalk = false;
data->configured = false;
data->comSpeed = OPLINKSETTINGS_COMSPEED_9600;
PIOS_COM_RADIO = PIOS_COM_RFM22B;
@ -590,6 +594,12 @@ static void updateSettings()
OPLinkSettingsData oplinkSettings;
OPLinkSettingsGet(&oplinkSettings);
// We can only configure the hardware once.
if (data->configured) {
return;
}
data->configured = true;
// Configure the main port
bool is_coordinator = PIOS_RFM22B_IsCoordinator(pios_rfm22b_id);
switch (oplinkSettings.MainPort) {