diff options
author | Simon Wilks <sjwilks@gmail.com> | 2012-11-30 08:12:20 +0100 |
---|---|---|
committer | Simon Wilks <sjwilks@gmail.com> | 2012-11-30 08:12:20 +0100 |
commit | 9924c4f425bc9fc507e7d065cc373a6cd9bbfebd (patch) | |
tree | 4a2ca7b7502c87c8ac35bc0d66db48689130ecf9 /apps/hott_telemetry | |
parent | c149b26dd44ebdd84ee3fd72cda3caea893191b2 (diff) | |
download | px4-firmware-9924c4f425bc9fc507e7d065cc373a6cd9bbfebd.tar.gz px4-firmware-9924c4f425bc9fc507e7d065cc373a6cd9bbfebd.tar.bz2 px4-firmware-9924c4f425bc9fc507e7d065cc373a6cd9bbfebd.zip |
Addressed compiler warnings and handle non-supported devices properly.
Diffstat (limited to 'apps/hott_telemetry')
-rw-r--r-- | apps/hott_telemetry/hott_telemetry_main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/hott_telemetry/hott_telemetry_main.c b/apps/hott_telemetry/hott_telemetry_main.c index 1eccf50a1..ae6c69b99 100644 --- a/apps/hott_telemetry/hott_telemetry_main.c +++ b/apps/hott_telemetry/hott_telemetry_main.c @@ -135,8 +135,8 @@ static int open_uart(const char *device, struct termios *uart_config_original) } /* Get the appropriate GPIO pin and control register */ - uint32_t gpio_uart; - uint32_t uart_cr3; + uint32_t gpio_uart = GPIO_USART2_TX;; + uint32_t uart_cr3 = STM32_USART2_CR3; switch (device[strlen(device) - 1]) { case '0': @@ -149,16 +149,16 @@ static int open_uart(const char *device, struct termios *uart_config_original) uart_cr3 = STM32_USART2_CR3; break; - case '2': - sprintf(msg, "/dev/ttyS3 is not supported.\n", device); - close(uart); - FATAL_MSG(msg); - break; - case '3': gpio_uart = GPIO_USART6_TX; uart_cr3 = STM32_USART6_CR3; break; + + default: + sprintf(msg, "%s is not supported.\n", device); + close(uart); + FATAL_MSG(msg); + break; } /* Change the TX port to be open-drain */ |