This fixes bugs when USBPLAT or FIRMATA is enabled when a NULL platform is
added or even a platform without ADC
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
INFO is not a valid cmake message mode, this commit cleans up a few messages to
use the correct cmake modes
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Add pin commands. Old mraa_setup_mux_mapped style is used for other boards
(pincmd = PINCMD_UNDEFINED) where pincmds are not defined.Remove useless
pullup_enable code, Galileo Gen2: review all pin mux and add commands Galileo
Gen2: remove doubled functionality: mraa_intel_galileo_gen2_i2c_init_pre and
mraa_intel_galileo_gen2_uart_init_pre. Galileo Gen2: fix "Invalid AIO pin
specified - do you have an ADC?" error. Galileo Gen2: pullup/pulldown
resistors are disabled during UART/GPIO/SPI/I2C/UIO initialization. Use
mraa_gpio_mode to enable resistors.
Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
We should throw exception but SWIG_Error causes a seg fault.
We should use syslog instead of stderr but syslog.h is not swigable
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
To ensure backwards comptability MRAA_ERROR_PLATFORM_ALREADY_INITIALISED
remains as member of mraa_result_t but now has same code as MRAA_SUCCESS
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This is a partial replication of firmata branch commit 2f25468
as that patch would not apply to the javacheck2 branch
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
The reason for this is that applications that use mraa, like upm, need the
definitions contained in jni header.
Signed-off-by: Andrei Vasiliu <andrei.vasiliu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Example now takes pin number from command line and displays gpio level
when it changes.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This is a re-design of commit 0041801. mraa_lang_func_t structure has been
added (similar in design to mraa_adv_func_t) that points to JNI functions
implemented in src/java/mraajni.c. Functions are set by libmraajava.so,
see wrapper entry in src/java/mraajava.i. As gpio.c now uses these
functions, language specific #ifdef code has been removed as JNI code
is only called if functions are defined (i.e. not NULL)
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
libmraajava.so was statically linking to mraa object files causing
duplicate mraa platform instances if a UPM Java module was also loaded.
JNI functionality has been moved into src/java/mraajni.c. JVM object is
now set when JVM is loaded; see updates to src/java/mraajava.i.
This was necessary as the JVM object cannot be directly referenced from
mraa as it will not be available when building C/C++ examples.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa.node was statically linking to mraa object files causing duplicate
mraa platform instances if a upm node.js module was also loaded.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Refactored of I/O expander support to simplify addition of new devices.
This had added ISR support for PCA9555.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
GPIO expander ISRs were dropping interrupts as each pin had its own
thread which cleared the INT signal when reading the GPIO register.
Thus pending interrupts for GPIO on threads waiting to be scheduled
were dropped. Now a single thread polls the GPIO register when INT goes
low and sets interrupt flags for each GPIO line. The threads created
by mraa_gpio_isr() now poll the appropriate interrupt flag.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>