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:
committed by
Thomas Ingleby
parent
c30457e434
commit
88f3052d99
@@ -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().
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user