From 4da0812acd21ac7e76583a028d5abcc9cf271a7a Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Mon, 6 Mar 2017 17:08:05 -0600 Subject: [PATCH] Fixing issue where using alt name for the XIO would cause a segfault when speficying the pin as an input. This will close #62 --- CHANGELOG.rst | 4 ++++ Makefile | 1 + debian/changelog | 8 +++++++- debian/files | 4 ++-- setup.py | 2 +- source/common.c | 6 +++--- source/constants.c | 2 +- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 16deb25..6104025 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,7 @@ +0.5.5 +--- +* Fix for Issue #62 where using alternate name of an XIO would cause a segfault due to trying to set pull up/down resistor setting + 0.5.4 --- * Re-enabled the polarity setting for PWM based upon Issue #61 diff --git a/Makefile b/Makefile index 881553b..204efc0 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ clean: rm -f *.pyo *.pyc rm -f *.egg rm -rf __pycache__ + rm -rf test/__pycache__/ rm -rf debian/python-chip-io* rm -rf debian/python3-chip-io* diff --git a/debian/changelog b/debian/changelog index 674e447..0589677 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +chip-io (0.5.5-1) unstable; urgency=low + + * Fix for Issue #62 where using alternate name of an XIO would cause a segfault due to trying to set pull up/down resistor setting + + -- Robert Wolterman Mon, 6 Mar 2017 17:02:00 -0600 + chip-io (0.5.4-1) unstable; urgency=low * Re-enabled the polarity setting for PWM based upon Issue #61 @@ -5,7 +11,7 @@ chip-io (0.5.4-1) unstable; urgency=low * Cleaned up the polarity setting code to work when PWM is not enabled * Fixed the unit test for pwm to verify we can set polarity - -- Robert Wolterman Sun, 26 Feb 2017 20:46:00 -0600 + -- Robert Wolterman Sat, 4 Mar 2017 20:46:00 -0600 chip-io (0.5.3-1) unstable; urgency=low diff --git a/debian/files b/debian/files index 5f46cfe..9560fa2 100644 --- a/debian/files +++ b/debian/files @@ -1,2 +1,2 @@ -python-chip-io_0.5.3-1_armhf.deb python optional -python3-chip-io_0.5.3-1_armhf.deb python optional +python-chip-io_0.5.4-1_armhf.deb python optional +python3-chip-io_0.5.4-1_armhf.deb python optional diff --git a/setup.py b/setup.py index e987c0c..543eca9 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ classifiers = ['Development Status :: 3 - Alpha', 'Topic :: System :: Hardware'] setup(name = 'CHIP_IO', - version = '0.5.4', + version = '0.5.5', author = 'Robert Wolterman', author_email = 'robert.wolterman@gmail.com', description = 'A module to control CHIP IO channels', diff --git a/source/common.c b/source/common.c index 430bf36..2c10e7f 100644 --- a/source/common.c +++ b/source/common.c @@ -263,7 +263,7 @@ int gpio_allowed(int gpio) // We have a CHIP and the pin is for CHIP/BOTH if (((p->sbc_type == CHIP) || (p->sbc_type == BOTH)) && (is_this_chippro() == 0)) { if (DEBUG) - printf(" ** gpio_allowed: pin allowed for chip or bth and we're a chip\n"); + printf(" ** gpio_allowed: pin allowed for chip or both and we're a chip\n"); rtnval = 1; // We have a CHIP Pro and the pin is for CHIPPRO/BOTH } else if (((p->sbc_type == CHIPPRO) || (p->sbc_type == BOTH)) && (is_this_chippro() == 1)) { @@ -296,7 +296,7 @@ int pwm_allowed(const char *key) // We have a CHIP and the pin is for CHIP/BOTH if ((p->sbc_type == BOTH) && (is_this_chippro() == 0)) { if (DEBUG) - printf(" ** pwm_allowed: pwm allowed for chip or bth and we're a chip\n"); + printf(" ** pwm_allowed: pwm allowed for chip or both and we're a chip\n"); rtnval = 1; // We have a CHIP Pro and the pin is for CHIPPRO/BOTH } else if (((p->sbc_type == CHIPPRO) || (p->sbc_type == BOTH)) && (is_this_chippro() == 1)) { @@ -554,7 +554,7 @@ int compute_port_pin(const char *key, int gpio, int *port, int *pin) if (capable < 0) { capable = lookup_pud_capable_by_name(key); if (capable < 0) { - capable = lookup_gpio_by_altname(key); + capable = lookup_pud_capable_by_altname(key); if (capable < 0) { capable = 0; // default to false } diff --git a/source/constants.c b/source/constants.c index 9145346..acf6090 100644 --- a/source/constants.c +++ b/source/constants.c @@ -85,6 +85,6 @@ void define_constants(PyObject *module) bcm = Py_BuildValue("i", BCM); PyModule_AddObject(module, "BCM", bcm); - version = Py_BuildValue("s", "0.5.4"); + version = Py_BuildValue("s", "0.5.5"); PyModule_AddObject(module, "VERSION", version); }