From: Thomas Ingleby Date: Fri, 11 Jul 2014 10:56:45 +0000 (+0100) Subject: Merge branch 'hook' X-Git-Tag: v0.4.2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bacfcff5fdebebca5f306ce7fbd4cc0a70f7e65;p=contrib%2Fmraa.git Merge branch 'hook' Conflicts: include/intel_galileo_rev_d.h include/intel_galileo_rev_g.h include/mraa_adv_func.h include/mraa_internal.h src/gpio/gpio.c src/mraa.c --- 9bacfcff5fdebebca5f306ce7fbd4cc0a70f7e65 diff --cc include/mraa_internal.h index a8abf6a,f7ca87f..8872a58 --- a/include/mraa_internal.h +++ b/include/mraa_internal.h @@@ -24,9 -24,16 +24,15 @@@ #pragma once + #ifdef __cplusplus + extern "C" { + #endif + #include "common.h" -#include "mraa_adv_func.h" #include "mraa_internal_types.h" + extern mraa_adv_func advance_func; + /** Setup gpio * * Will check input is valid for gpio and will also setup required multiplexers. @@@ -78,9 -85,6 +84,13 @@@ mraa_mmap_pin_t* mraa_setup_mmap_gpio(i */ mraa_result_t mraa_swap_complex_gpio(int pin, int out); +/** Setup uart muxes to exposes the pins physically. + * + * @param index of the uart in the board definition to expose physically + * @return mraa_result_t of operation + */ +mraa_result_t mraa_setup_uart(int index); ++ + #ifdef __cplusplus + } + #endif diff --cc src/gpio/gpio.c index 05993f4,f61b172..338ad09 --- a/src/gpio/gpio.c +++ b/src/gpio/gpio.c @@@ -67,6 -67,11 +67,12 @@@ mraa_gpio_init(int pin mraa_gpio_context mraa_gpio_init_raw(int pin) { + if (advance_func.gpio_init_pre != NULL) { + printf("Actually entering\n"); + if (advance_func.gpio_init_pre(pin) != MRAA_SUCCESS) + return NULL; + } ++ if (pin < 0) return NULL; @@@ -347,6 -375,13 +376,14 @@@ mraa_gpio_mode(mraa_gpio_context dev, g mraa_result_t mraa_gpio_dir(mraa_gpio_context dev, gpio_dir_t dir) { + if (advance_func.gpio_dir_replace != NULL) + return advance_func.gpio_dir_replace(dev,dir); + if (advance_func.gpio_dir_pre != NULL) { + mraa_result_t pre_ret = (advance_func.gpio_dir_pre(dev,dir)); + if(pre_ret != MRAA_SUCCESS) + return pre_ret; + } ++ if (dev == NULL) { return MRAA_ERROR_INVALID_HANDLE; }