From cad1632e40717d9a33bc7ddb4b773fa761ba81ff Mon Sep 17 00:00:00 2001 From: Verne Roberts Date: Thu, 5 Jan 2017 00:31:47 +1300 Subject: [PATCH] Add 31250 baud rate for MIDI support (#1690) * add 31250 baud rate for MIDI support * add bitrate to uart_bitrates array for the get operation --- app/include/driver/uart.h | 1 + app/platform/platform.c | 2 ++ docs/en/modules/uart.md | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/include/driver/uart.h b/app/include/driver/uart.h index 68b55a4e..a308ec61 100755 --- a/app/include/driver/uart.h +++ b/app/include/driver/uart.h @@ -41,6 +41,7 @@ typedef enum { BIT_RATE_4800 = 4800, BIT_RATE_9600 = 9600, BIT_RATE_19200 = 19200, + BIT_RATE_31250 = 31250, BIT_RATE_38400 = 38400, BIT_RATE_57600 = 57600, BIT_RATE_74880 = 74880, diff --git a/app/platform/platform.c b/app/platform/platform.c index d1dbc2d9..c6ca0f61 100755 --- a/app/platform/platform.c +++ b/app/platform/platform.c @@ -40,6 +40,7 @@ static const int uart_bitrates[] = { BIT_RATE_4800, BIT_RATE_9600, BIT_RATE_19200, + BIT_RATE_31250, BIT_RATE_38400, BIT_RATE_57600, BIT_RATE_74880, @@ -361,6 +362,7 @@ uint32_t platform_uart_setup( unsigned id, uint32_t baud, int databits, int pari case BIT_RATE_4800: case BIT_RATE_9600: case BIT_RATE_19200: + case BIT_RATE_31250: case BIT_RATE_38400: case BIT_RATE_57600: case BIT_RATE_74880: diff --git a/docs/en/modules/uart.md b/docs/en/modules/uart.md index fd1c52e9..49c376c9 100644 --- a/docs/en/modules/uart.md +++ b/docs/en/modules/uart.md @@ -74,7 +74,7 @@ end, 0) #### Parameters - `id` always zero, only one uart supported -- `baud` one of 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400 +- `baud` one of 300, 600, 1200, 2400, 4800, 9600, 19200, 31250, 38400, 57600, 74880, 115200, 230400, 256000, 460800, 921600, 1843200, 3686400 - `databits` one of 5, 6, 7, 8 - `parity` `uart.PARITY_NONE`, `uart.PARITY_ODD`, or `uart.PARITY_EVEN` - `stopbits` `uart.STOPBITS_1`, `uart.STOPBITS_1_5`, or `uart.STOPBITS_2`