From 9924c4f425bc9fc507e7d065cc373a6cd9bbfebd Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Fri, 30 Nov 2012 08:12:20 +0100 Subject: [PATCH] Addressed compiler warnings and handle non-supported devices properly. --- apps/hott_telemetry/hott_telemetry_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/hott_telemetry/hott_telemetry_main.c b/apps/hott_telemetry/hott_telemetry_main.c index 1eccf50a18..ae6c69b99d 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 */