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

2 Commits

5 changed files with 8 additions and 10 deletions

View File

@ -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.

View File

@ -19,7 +19,6 @@ For Python2.7::
cd CHIP_IO
sudo python setup.py install
cd ..
sudo rm -rf CHIP_IO
For Python3::
@ -34,7 +33,6 @@ For Python3::
cd CHIP_IO
sudo python3 setup.py install
cd ..
sudo rm -rf CHIP_IO
**Usage**

View File

@ -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',

View File

@ -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);
}

View File

@ -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