mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-19 20:33:21 +00:00
quick fix because i broke xio input setup with the pud code, this closes #58
This commit is contained in:
@ -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.
|
||||
|
2
setup.py
2
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',
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user