Private
Public Access
2
0

uart: use an unsigned int for baud rate rather than speed_t

uart.c contains a static conversion function that will translate known
baud rates into their speed_t counter parts.  If an unsupported baud
rate is selected, a diagnostic will be emitted via syslog and a
default of B9600 will be chosen.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Jon Trulson
2015-04-30 14:12:45 -06:00
committed by Thomas Ingleby
parent c30457e434
commit 88f3052d99
3 changed files with 49 additions and 5 deletions

View File

@@ -83,7 +83,7 @@ char* mraa_uart_get_dev_path(mraa_uart_context dev);
* @param baud desired baud rate
* @return mraa_result_t
*/
mraa_result_t mraa_uart_open_dev(mraa_uart_context dev, speed_t baud);
mraa_result_t mraa_uart_open_dev(mraa_uart_context dev, unsigned int baud);
/**
* Close a device previously opened with mraa_uart_open_dev().

View File

@@ -85,7 +85,7 @@ class Uart
* @return mraa_result_t
*/
mraa_result_t
openDevice(speed_t baud)
openDevice(unsigned int baud)
{
return mraa_uart_open_dev(m_uart, baud);
}