1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 04:43:21 +00:00

Update py_gpio.c

allow passing data arguments to c callbacks
This commit is contained in:
fabien-gigante
2016-08-26 16:06:43 +02:00
committed by GitHub
parent d95847eb5a
commit 9a83cf765a

View File

@ -225,7 +225,7 @@ static PyObject *py_input_gpio(PyObject *self, PyObject *args)
return py_value;
}
static void run_py_callbacks(int gpio)
static void run_py_callbacks(int gpio, void* data)
{
PyObject *result;
PyGILState_STATE gstate;
@ -294,7 +294,7 @@ static int add_py_callback(char *channel, int gpio, int edge, unsigned int bounc
cb = cb->next;
cb->next = new_py_cb;
}
add_edge_callback(gpio, edge, run_py_callbacks);
add_edge_callback(gpio, edge, run_py_callbacks, NULL);
return 0;
}