mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-19 12:23:22 +00:00
added logging to inform user of 1s retry if set_direction fails on the first try, updating to v0.7.1
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
0.7.1
|
||||
---
|
||||
* Merged in PR #79
|
||||
* Merged in PR #80
|
||||
* Added message notifying user of the gpio set direction retry
|
||||
|
||||
0.7.0
|
||||
---
|
||||
* Added ability to specify GPIO only as a number, this doesn't work for PWM/SPWM/LRADC/SERVO
|
||||
|
29
debian/changelog
vendored
29
debian/changelog
vendored
@ -1,36 +1,43 @@
|
||||
chip-io (0.7.1-1) unstable; urgency=low
|
||||
|
||||
* Merged PR#79 and#80
|
||||
* Added logging to tell user of the 1 second sleep before retry on setting gpio direction
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Sun, 12 Nov 2017 07:40:00 -0600
|
||||
|
||||
chip-io (0.7.0-1) unstable; urgency=low
|
||||
|
||||
* Added ability to specify GPIO only as a number, this doesn't work for PWM/SPWM/LRADC/SERVO
|
||||
* Added ability to specify GPIO only as a number, this doesn't work for PWM/SPWM/LRADC/SERVO
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Wed, 13 Sep 2017 09:51:00 -0600
|
||||
|
||||
chip-io (0.6.2-1) unstable; urgency=low
|
||||
|
||||
* Implementation for number 77 ability to push up binary pypi
|
||||
* Implementation for number 75 wait for edge timeout
|
||||
* Implementation for number 77 ability to push up binary pypi
|
||||
* Implementation for number 75 wait for edge timeout
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Sun, 03 Sep 2017 21:34:00 -0600
|
||||
|
||||
chip-io (0.6.1-1) unstable; urgency=low
|
||||
|
||||
* Fixing implementation for #76
|
||||
* Fixing implementation for #76
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Wed, 09 Aug 2017 23:09:00 -0600
|
||||
|
||||
chip-io (0.6.0-1) unstable; urgency=low
|
||||
|
||||
* Random comment cleanup
|
||||
* Implement fix for #76
|
||||
* API documentation added
|
||||
* Closing #74
|
||||
* Random comment cleanup
|
||||
* Implement fix for #76
|
||||
* API documentation added
|
||||
* Closing #74
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Wed, 09 Aug 2017 22:50:00 -0600
|
||||
|
||||
chip-io (0.5.9-1) unstable; urgency=low
|
||||
|
||||
* Merged PR#70 to enable the underlying C code to be used properly in C based code
|
||||
* Updated README to add missing pins on the CHIP Pro that are available as GPIO
|
||||
* Updated README to denote pins that are available for Edge Detection
|
||||
* Merged PR#70 to enable the underlying C code to be used properly in C based code
|
||||
* Updated README to add missing pins on the CHIP Pro that are available as GPIO
|
||||
* Updated README to denote pins that are available for Edge Detection
|
||||
|
||||
-- Robert Wolterman <robert.wolterman@gmail.com> Tue, 08 Jun 2017 20:03:00 -0600
|
||||
|
||||
|
4
debian/files
vendored
4
debian/files
vendored
@ -1,2 +1,2 @@
|
||||
python-chip-io_0.7.0-1_armhf.deb python optional
|
||||
python3-chip-io_0.7.0-1_armhf.deb python optional
|
||||
python-chip-io_0.7.1-1_armhf.deb python optional
|
||||
python3-chip-io_0.7.1-1_armhf.deb python optional
|
||||
|
2
setup.py
2
setup.py
@ -13,7 +13,7 @@ classifiers = ['Development Status :: 3 - Alpha',
|
||||
'Topic :: System :: Hardware']
|
||||
|
||||
setup(name = 'CHIP_IO',
|
||||
version = '0.7.0',
|
||||
version = '0.7.1',
|
||||
author = 'Robert Wolterman',
|
||||
author_email = 'robert.wolterman@gmail.com',
|
||||
description = 'A module to control CHIP IO channels',
|
||||
|
@ -85,6 +85,6 @@ void define_constants(PyObject *module)
|
||||
bcm = Py_BuildValue("i", BCM);
|
||||
PyModule_AddObject(module, "BCM", bcm);
|
||||
|
||||
version = Py_BuildValue("s", "0.7");
|
||||
version = Py_BuildValue("s", "0.7.1");
|
||||
PyModule_AddObject(module, "VERSION", version);
|
||||
}
|
||||
|
@ -385,10 +385,15 @@ int gpio_set_direction(int gpio, unsigned int in_flag)
|
||||
snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d/direction", gpio); BUF2SMALL(filename);
|
||||
|
||||
if ((fd = open(filename, O_WRONLY)) < 0) {
|
||||
// NOTIFY THAT WE'RE GOING TO SLEEP AND RETRY
|
||||
char err[256];
|
||||
snprintf(err, sizeof(err), "gpio_set_direction: could not open '%s', sleeping for 1 second and retrying", filename);
|
||||
add_error_msg(err);
|
||||
// if called as non-root, udev may need time to adjust file
|
||||
// permissions after setting up gpio
|
||||
sleep(1);
|
||||
|
||||
// TRY AGAIN AND IF THIS TIME FAILS, KICK OUT
|
||||
if ((fd = open(filename, O_WRONLY)) < 0) {
|
||||
char err[256];
|
||||
snprintf(err, sizeof(err), "gpio_set_direction: could not open '%s' (%s)", filename, strerror(errno));
|
||||
|
Reference in New Issue
Block a user