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

Fixed softpwm bug ("disable" code didn't synchronize thread exit)

This commit is contained in:
fordsfords
2016-07-09 18:42:38 -05:00
parent 7123c0e308
commit 7812063991
8 changed files with 57 additions and 43 deletions

View File

@ -213,7 +213,12 @@ static PyObject *py_input_gpio(PyObject *self, PyObject *args)
return NULL;
}
gpio_get_value(gpio, &value);
if (gpio_get_value(gpio, &value) < 0) {
char err[1024];
snprintf(err, sizeof(err), "Could not get value ('%s')", get_error_msg());
PyErr_SetString(PyExc_RuntimeError, err);
return NULL;
}
py_value = Py_BuildValue("i", value);
@ -567,7 +572,12 @@ static PyObject *py_gpio_function(PyObject *self, PyObject *args)
return NULL;
}
gpio_get_direction(gpio, &value);
if (gpio_get_direction(gpio, &value) < 0) {
char err[1024];
snprintf(err, sizeof(err), "Could not get direction ('%s')", get_error_msg());
PyErr_SetString(PyExc_RuntimeError, err);
return NULL;
}
func = Py_BuildValue("i", value);
return func;
}