mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-20 12:53:22 +00:00
More error checking work
This commit is contained in:
@ -170,7 +170,9 @@ static PyObject *py_output_gpio(PyObject *self, PyObject *args)
|
|||||||
|
|
||||||
if (!module_setup || dyn_int_array_get(&gpio_direction, gpio, -1) != OUTPUT)
|
if (!module_setup || dyn_int_array_get(&gpio_direction, gpio, -1) != OUTPUT)
|
||||||
{
|
{
|
||||||
PyErr_SetString(PyExc_RuntimeError, "The GPIO channel has not been setup() as an OUTPUT");
|
char err[2000];
|
||||||
|
snprintf(err, sizeof(err), "Channel %s not set up or is not an output", channel);
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, err);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user