Private
Public Access
2
0

swig: Add support for isr/callbacks from python

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-13 20:45:00 +00:00
parent b8e0ca76b1
commit f7169cc5c5
6 changed files with 70 additions and 0 deletions

View File

@@ -34,6 +34,10 @@
extern "C" {
#endif
#ifdef SWIG
#include <Python.h>
#endif
#include <stdio.h>
#include <pthread.h>
@@ -46,7 +50,11 @@ typedef struct {
/*@{*/
int pin; /**< the pin number, as known to the os. */
int value_fp; /**< the file pointer to the value of the gpio */
#ifdef SWIG
PyObject *isr; /**< the interupt service request */
#else
void (* isr)(); /**< the interupt service request */
#endif
pthread_t thread_id; /**< the isr handler thread id */
int isr_value_fp; /**< the isr file pointer on the value */
/*@}*/