Private
Public Access
2
0

uart: add init post hook

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-10-19 16:09:19 +01:00
parent 0f2329bd95
commit 071951e926
3 changed files with 18 additions and 9 deletions

View File

@@ -30,15 +30,6 @@
#include "uart.h"
#include "mraa_internal.h"
/**
* A structure representing a UART device
*/
struct _uart {
/*@{*/
int index; /**< the uart index, as known to the os. */
/*@}*/
};
mraa_uart_context
mraa_uart_init(int index)
{
@@ -49,6 +40,13 @@ mraa_uart_init(int index)
memset(dev, 0, sizeof(struct _uart));
dev->index = index;
if (advance_func->uart_init_post != NULL) {
mraa_result_t ret = advance_func->uart_init_post(dev);
if (ret != MRAA_SUCCESS) {
free(dev);
return NULL;
}
}
return dev;
}