mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-20 12:53:22 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
2e2177da26 | |||
541d76f641 |
@ -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
|
0.3.4
|
||||||
---
|
---
|
||||||
* Pull Up/Pull Down resistor setting now available for the R8 GPIO.
|
* Pull Up/Pull Down resistor setting now available for the R8 GPIO.
|
||||||
|
@ -19,7 +19,6 @@ For Python2.7::
|
|||||||
cd CHIP_IO
|
cd CHIP_IO
|
||||||
sudo python setup.py install
|
sudo python setup.py install
|
||||||
cd ..
|
cd ..
|
||||||
sudo rm -rf CHIP_IO
|
|
||||||
|
|
||||||
For Python3::
|
For Python3::
|
||||||
|
|
||||||
@ -34,7 +33,6 @@ For Python3::
|
|||||||
cd CHIP_IO
|
cd CHIP_IO
|
||||||
sudo python3 setup.py install
|
sudo python3 setup.py install
|
||||||
cd ..
|
cd ..
|
||||||
sudo rm -rf CHIP_IO
|
|
||||||
|
|
||||||
**Usage**
|
**Usage**
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -20,7 +20,7 @@ classifiers = ['Development Status :: 3 - Alpha',
|
|||||||
'Topic :: System :: Hardware']
|
'Topic :: System :: Hardware']
|
||||||
|
|
||||||
setup(name = 'CHIP_IO',
|
setup(name = 'CHIP_IO',
|
||||||
version = '0.3.4',
|
version = '0.3.4.1',
|
||||||
author = 'Robert Wolterman',
|
author = 'Robert Wolterman',
|
||||||
author_email = 'robert.wolterman@gmail.com',
|
author_email = 'robert.wolterman@gmail.com',
|
||||||
description = 'A module to control CHIP IO channels',
|
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);
|
module_debug = Py_BuildValue("i", DEBUG ? Py_True: Py_False);
|
||||||
PyModule_AddObject(module, "DEBUG", module_debug);
|
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);
|
PyModule_AddObject(module, "VERSION", version);
|
||||||
}
|
}
|
||||||
|
@ -186,13 +186,9 @@ static PyObject *py_setup_channel(PyObject *self, PyObject *args, PyObject *kwar
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pull Up/Down
|
// Pull Up/Down
|
||||||
|
// Only if the pin we want is able to use it (R8 Owned, no XIO)
|
||||||
int port, pin;
|
int port, pin;
|
||||||
if (compute_port_pin(channel, gpio, &port, &pin) < 0) {
|
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 {
|
|
||||||
// Set the PUD
|
// Set the PUD
|
||||||
gpio_set_pud(port, pin, pud);
|
gpio_set_pud(port, pin, pud);
|
||||||
// Check it was set properly
|
// Check it was set properly
|
||||||
|
Reference in New Issue
Block a user