From 22b9b2512eaadd7f68a6056abc91107bf93603fe Mon Sep 17 00:00:00 2001 From: pip Date: Wed, 15 Sep 2010 14:43:42 +0000 Subject: [PATCH] Added a 115200 baud telemetry option to the OP main board/UAVTalk. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1632 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../OpenPilot/Modules/Telemetry/telemetry.c | 21 ++++++++----------- .../UAVObjects/inc/telemetrysettings.h | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/flight/OpenPilot/Modules/Telemetry/telemetry.c b/flight/OpenPilot/Modules/Telemetry/telemetry.c index d5ae7764c..f1699fcf8 100644 --- a/flight/OpenPilot/Modules/Telemetry/telemetry.c +++ b/flight/OpenPilot/Modules/Telemetry/telemetry.c @@ -537,21 +537,18 @@ static void updateSettings() { // Set port telemetryPort = PIOS_COM_TELEM_RF; + // Retrieve settings TelemetrySettingsGet(&settings); + // Set port speed - if (settings.Speed == TELEMETRYSETTINGS_SPEED_9600) - { - PIOS_COM_ChangeBaud(telemetryPort, 9600); - } - else if (settings.Speed == TELEMETRYSETTINGS_SPEED_57600) - { - PIOS_COM_ChangeBaud(telemetryPort, 57600); - } - else if (settings.Speed == TELEMETRYSETTINGS_SPEED_38400) - { - PIOS_COM_ChangeBaud(telemetryPort, 38400); - } + if (settings.Speed == TELEMETRYSETTINGS_SPEED_9600) PIOS_COM_ChangeBaud(telemetryPort, 9600); + else + if (settings.Speed == TELEMETRYSETTINGS_SPEED_38400) PIOS_COM_ChangeBaud(telemetryPort, 38400); + else + if (settings.Speed == TELEMETRYSETTINGS_SPEED_57600) PIOS_COM_ChangeBaud(telemetryPort, 57600); + else + if (settings.Speed == TELEMETRYSETTINGS_SPEED_115200) PIOS_COM_ChangeBaud(telemetryPort, 115200); } /** diff --git a/flight/OpenPilot/UAVObjects/inc/telemetrysettings.h b/flight/OpenPilot/UAVObjects/inc/telemetrysettings.h index 6bc785ce2..db2f5ad74 100644 --- a/flight/OpenPilot/UAVObjects/inc/telemetrysettings.h +++ b/flight/OpenPilot/UAVObjects/inc/telemetrysettings.h @@ -78,7 +78,7 @@ typedef struct { // Field information // Field Speed information /* Enumeration options for field Speed */ -typedef enum { TELEMETRYSETTINGS_SPEED_9600=0, TELEMETRYSETTINGS_SPEED_38400=1, TELEMETRYSETTINGS_SPEED_57600=2 } TelemetrySettingsSpeedOptions; +typedef enum { TELEMETRYSETTINGS_SPEED_9600=0, TELEMETRYSETTINGS_SPEED_38400=1, TELEMETRYSETTINGS_SPEED_57600=2, TELEMETRYSETTINGS_SPEED_115200=3 } TelemetrySettingsSpeedOptions; // Generic interface functions