Private
Public Access
2
0

uart: cleanup and bring inline with standard

Removed mraa_setup_uart from core mraa.c moved logic within init
function
Add more syslog output for easier debugging.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2015-01-20 14:44:28 +00:00
parent 20d229168b
commit ed4c68eba1
3 changed files with 42 additions and 41 deletions

View File

@@ -300,35 +300,6 @@ mraa_adc_supported_bits()
return plat->adc_supported;
}
mraa_result_t
mraa_setup_uart(int index)
{
if (plat == NULL)
return MRAA_ERROR_PLATFORM_NOT_INITIALISED;
if (plat->uart_dev_count == 0)
return MRAA_ERROR_FEATURE_NOT_SUPPORTED;
if (plat->uart_dev_count <= index)
return MRAA_ERROR_NO_RESOURCES;
int pos = plat->uart_dev[index].rx;
if (pos >= 0) {
if (plat->pins[pos].uart.mux_total > 0)
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS)
return MRAA_ERROR_INVALID_RESOURCE;
}
if (pos >= 0) {
pos = plat->uart_dev[index].tx;
if (plat->pins[pos].uart.mux_total > 0)
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS)
return MRAA_ERROR_INVALID_RESOURCE;
}
return MRAA_SUCCESS;
}
char*
mraa_get_platform_name()
{