diff options
author | Stefan Agner <stefan@agner.ch> | 2016-05-02 19:13:19 -0700 |
---|---|---|
committer | Stefan Agner <stefan@agner.ch> | 2016-05-09 17:17:05 -0700 |
commit | 21d6d84123de8e6e2ebdf5543b530403951b3059 (patch) | |
tree | 046a7fa39e1c7cff49792ac67f1ae899271a56b7 /platform/utilities | |
parent | 2fb8ccd4adf6433033a402e2fa07c2f11c489518 (diff) |
resync with FreeRTOS_BSP_1.0.1_iMX7D
Diffstat (limited to 'platform/utilities')
-rw-r--r-- | platform/utilities/inc/debug_console_imx.h | 6 | ||||
-rw-r--r-- | platform/utilities/src/debug_console_imx.c | 1 | ||||
-rw-r--r-- | platform/utilities/src/print_scan.c | 32 |
3 files changed, 24 insertions, 15 deletions
diff --git a/platform/utilities/inc/debug_console_imx.h b/platform/utilities/inc/debug_console_imx.h index 21069b8..6779e67 100644 --- a/platform/utilities/inc/debug_console_imx.h +++ b/platform/utilities/inc/debug_console_imx.h @@ -76,11 +76,11 @@ extern "C" { */ /*! - * @brief Init the UART_IMX used for debug messages. + * @brief Initialize the UART_IMX used for debug messages. * * Call this function to enable debug log messages to be output via the specified UART_IMX * base address and at the specified baud rate. Just initializes the UART_IMX to the given baud - * rate and 8N1. After this function has returned, stdout and stdin will be connected to the + * rate and 8N1. After this function has returned, stdout and stdin are connected to the * selected UART_IMX. The debug_printf() function also uses this UART_IMX. * * @param base Which UART_IMX instance is used to send debug messages. @@ -95,7 +95,7 @@ debug_console_status_t DbgConsole_Init(UART_Type* base, uint32_t mode); /*! - * @brief Deinit the UART/LPUART used for debug messages. + * @brief Deinitialize the UART/LPUART used for debug messages. * * Call this function to disable debug log messages to be output via the specified UART/LPUART * base address and at the specified baud rate. diff --git a/platform/utilities/src/debug_console_imx.c b/platform/utilities/src/debug_console_imx.c index 93c9a3c..a03e441 100644 --- a/platform/utilities/src/debug_console_imx.c +++ b/platform/utilities/src/debug_console_imx.c @@ -366,6 +366,7 @@ void UART_SendDataPolling(void *base, const uint8_t *txBuff, uint32_t txSize) while (txSize--) { UART_Putchar((UART_Type*)base, *txBuff++); + while (!UART_GetStatusFlag((UART_Type*)base, uartStatusTxEmpty)); while (!UART_GetStatusFlag((UART_Type*)base, uartStatusTxComplete)); } } diff --git a/platform/utilities/src/print_scan.c b/platform/utilities/src/print_scan.c index 01667af..6c09099 100644 --- a/platform/utilities/src/print_scan.c +++ b/platform/utilities/src/print_scan.c @@ -756,7 +756,7 @@ static int32_t mkfloatnumstr (char *numstr, void *nump, int32_t radix, uint32_t for (i = 0; i < precision_width; i++) { fb = fa / (int32_t)radix; - c = (int32_t)(fa - (uint64_t)fb * (int32_t)radix); + c = (int32_t)(fa - (int64_t)fb * (int32_t)radix); if (c < 0) { c = ~c + 1 + '0'; @@ -771,20 +771,28 @@ static int32_t mkfloatnumstr (char *numstr, void *nump, int32_t radix, uint32_t *nstrp++ = (char)'.'; ++nlen; a = (int32_t)intpart; - while (a != 0) + if(a == 0) { - b = (int32_t)a / (int32_t)radix; - c = (int32_t)a - ((int32_t)b * (int32_t)radix); - if (c < 0) - { - c = ~c + 1 + '0'; - }else + *nstrp++ = '0'; + ++nlen; + } + else + { + while (a != 0) { - c = c + '0'; + b = (int32_t)a / (int32_t)radix; + c = (int32_t)a - ((int32_t)b * (int32_t)radix); + if (c < 0) + { + c = ~c + 1 + '0'; + }else + { + c = c + '0'; + } + a = b; + *nstrp++ = (char)c; + ++nlen; } - a = b; - *nstrp++ = (char)c; - ++nlen; } done: return nlen; |