From 2e2177da264c8bdade96ac14c97c6830b2971367 Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Sun, 29 Jan 2017 20:21:02 +0000 Subject: [PATCH] quick fix because i broke xio input setup with the pud code, this closes #58 --- CHANGELOG.rst | 4 ++++ setup.py | 2 +- source/constants.c | 2 +- source/py_gpio.c | 8 ++------ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f6ddded..a513f86 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,7 @@ +0.3.4.1 +--- +* Quick fix as I borked XIO setup as inputs with the latest change that enabled PUD + 0.3.4 --- * Pull Up/Pull Down resistor setting now available for the R8 GPIO. diff --git a/setup.py b/setup.py index 8779fc0..2f9dc4b 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ classifiers = ['Development Status :: 3 - Alpha', 'Topic :: System :: Hardware'] setup(name = 'CHIP_IO', - version = '0.3.4', + version = '0.3.4.1', author = 'Robert Wolterman', author_email = 'robert.wolterman@gmail.com', description = 'A module to control CHIP IO channels', diff --git a/source/constants.c b/source/constants.c index 684cbbb..da9a5e8 100644 --- a/source/constants.c +++ b/source/constants.c @@ -88,6 +88,6 @@ void define_constants(PyObject *module) module_debug = Py_BuildValue("i", DEBUG ? Py_True: Py_False); PyModule_AddObject(module, "DEBUG", module_debug); - version = Py_BuildValue("s", "0.3.4"); + version = Py_BuildValue("s", "0.3.4.1"); PyModule_AddObject(module, "VERSION", version); } diff --git a/source/py_gpio.c b/source/py_gpio.c index 6598986..e435882 100644 --- a/source/py_gpio.c +++ b/source/py_gpio.c @@ -186,13 +186,9 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar } // Pull Up/Down + // Only if the pin we want is able to use it (R8 Owned, no XIO) int port, pin; - if (compute_port_pin(channel, gpio, &port, &pin) < 0) { - char err[2000]; - snprintf(err, sizeof(err), "Pull Up/Down setting not capable for %s. (%s)", channel, get_error_msg()); - PyErr_SetString(PyExc_ValueError, err); - return NULL; - } else { + if (compute_port_pin(channel, gpio, &port, &pin) == 0) { // Set the PUD gpio_set_pud(port, pin, pud); // Check it was set properly