Private
Public Access
2
0

Compile libmraa for Android and Brillo

Add makefile for building libmraa library.

Import glob functionality from the NetBSD project where the glob.c and
glob.h files are released under BSD 3-clause License. Minor changes were
applied in order to make them compile for Android and Brillo.

This patch adds a control pipe used to interrupt the poll() function
as an alternative to pthread cancellation API.

Change-Id: Id719da4c839acbd320b0cc0e0113c2a5239c8029
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Mihai Serban
2015-11-12 18:26:23 +02:00
committed by Brendan Le Foll
parent 2dd94cda3b
commit ccafc77641
5 changed files with 1385 additions and 6 deletions

View File

@@ -30,6 +30,11 @@
#include "mraa_func.h"
#include "mraa_adv_func.h"
// Bionic does not implement pthread cancellation API
#ifndef __BIONIC__
#define HAVE_PTHREAD_CANCEL
#endif
// general status failures for internal functions
#define MRAA_PLATFORM_NO_INIT -3
#define MRAA_IO_SETUP_FAILURE -2
@@ -47,6 +52,9 @@ struct _gpio {
void *isr_args; /**< args return when interupt service request triggered */
pthread_t thread_id; /**< the isr handler thread id */
int isr_value_fp; /**< the isr file pointer on the value */
#ifndef HAVE_PTHREAD_CANCEL
int isr_control_pipe[2]; /**< a pipe used to interrupt the isr from polling the value fd*/
#endif
mraa_boolean_t isr_thread_terminating; /**< is the isr thread being terminated? */
mraa_boolean_t owner; /**< If this context originally exported the pin */
mraa_result_t (*mmap_write) (mraa_gpio_context dev, int value);