Comments (3)
source/common.c | 5 +++--
source/py_adc.c | 8 ++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/source/common.c b/source/common.c
index a5b6e3d..9d6dbec 100644
--- a/source/common.c
+++ b/source/common.c
@@ -339,7 +339,8 @@ int load_device_tree(const char *name)
file = fopen(slots, "r+");
if (!file) {
- return -1;
+ PyErr_SetFromErrnoWithFilename(PyExc_IOError, slots);
+ return 0;
}
while (fgets(line, sizeof(line), file)) {
@@ -392,4 +393,4 @@ int unload_device_tree(const char *name)
fclose(file);
return 1;
-}
\ No newline at end of file
+}
diff --git a/source/py_adc.c b/source/py_adc.c
index ccdb742..d208ef9 100644
--- a/source/py_adc.c
+++ b/source/py_adc.c
@@ -38,9 +38,9 @@ static PyObject *py_cleanup(PyObject *self, PyObject *args)
// python function setup()
static PyObject *py_setup_adc(PyObject *self, PyObject *args)
{
- adc_setup();
-
- Py_RETURN_NONE;
+ if (adc_setup())
+ Py_RETURN_NONE;
+ return NULL;
}
// python function read(channel)
@@ -152,4 +152,4 @@ PyMODINIT_FUNC initADC(void)
#else
return;
#endif
-}
\ No newline at end of file
+}
--
1.7.10.4
from adafruit-beaglebone-io-python.
Thanks! I'll get this merged in the next release.
from adafruit-beaglebone-io-python.
This is included in 0.0.14, and has been expanded to include PWM, and UART for the error handling.
from adafruit-beaglebone-io-python.
Related Issues (20)
- Probably errant delays in GPIO/PWM HOT 2
- Errors during installing Adafruit_BBIO with Pip HOT 1
- Set pin mode failed for uart channel. (UART4) HOT 4
- Cannot initialize GPIO.INPUT on BeagleBone Black Ubuntu 20.04 HOT 2
- PWM test code doesn't work. "Runtime Error: unknowm error"
- BeagleBone Black Wireless PWM: RuntimeError: Problem with the cape manager
- Can't Seem to Install Adafruit BBIO Library on BBB (multiple definition error) HOT 3
- Beaglebone SPIs
- Python lock up while using ADC HOT 1
- ValueError: Set gpio direction failed, missing file or invalid permissions.
- Measure frequency
- Reading pulse encoder incorrect
- sudo pip3 install Adafruit_BBIO fails on Python >= 3.9 HOT 1
- UART no response after upgrade to Buster (similar issue to #291)
- Compilation Warnings when building CPP library
- ValueError: Set gpio mode failed, missing file or invalid permissions. HOT 1
- GPIO.add_event_detect : does not properly handle lambda expressions HOT 1
- documentation error in encoder.py
- P9_28 - P9_29 - P9-31 pins setup as GPIO problem HOT 2
- SPI bits per word increase from 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit-beaglebone-io-python.