Created
March 2, 2017 06:53
-
-
Save pdp7/da586ee371a3720b402871a4f5e65c9f to your computer and use it in GitHub Desktop.
For issue 134: git diff of adafruit-beaglebone-io-python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
debian@beaglebone:~/adafruit-beaglebone-io-python$ git diff | |
diff --git a/source/event_gpio.c b/source/event_gpio.c | |
index dfe36e4..06125ba 100644 | |
--- a/source/event_gpio.c | |
+++ b/source/event_gpio.c | |
@@ -413,6 +413,7 @@ int add_edge_callback(unsigned int gpio, void (*func)(unsigned int gpio)) | |
void run_callbacks(unsigned int gpio) | |
{ | |
+ fprintf(stderr, "DEBUG: run_callbacks()\n"); | |
struct callback *cb = callbacks; | |
while (cb != NULL) | |
{ | |
@@ -473,6 +474,7 @@ int gpio_initial(unsigned int gpio) | |
void *poll_thread(__attribute__ ((unused)) void *threadarg) | |
{ | |
+ fprintf(stderr, "DEBUG: poll_thread()\n"); | |
struct epoll_event events; | |
char buf; | |
unsigned int gpio; | |
@@ -508,6 +510,7 @@ void *poll_thread(__attribute__ ((unused)) void *threadarg) | |
int gpio_is_evented(unsigned int gpio) | |
{ | |
+ fprintf(stderr, "DEBUG: gpio_is_evented()\n"); | |
struct fdx *f = fd_list; | |
while (f != NULL) | |
{ | |
@@ -520,6 +523,7 @@ int gpio_is_evented(unsigned int gpio) | |
int gpio_event_add(unsigned int gpio) | |
{ | |
+ fprintf(stderr, "DEBUG: gpio_event_add()\n"); | |
struct fdx *f = fd_list; | |
while (f != NULL) | |
{ | |
@@ -557,6 +561,7 @@ int add_edge_detect(unsigned int gpio, unsigned int edge) | |
// 1 - Edge detection already added | |
// 2 - Other error | |
{ | |
+ fprintf(stderr, "DEBUG: add_edge_detect()\n"); | |
int fd = fd_lookup(gpio); | |
pthread_t threads; | |
struct epoll_event ev; | |
@@ -638,6 +643,7 @@ void event_cleanup(void) | |
int blocking_wait_for_edge(unsigned int gpio, unsigned int edge, int timeout) | |
// standalone from all the event functions above | |
{ | |
+ fprintf(stderr, "DEBUG: blocking_wait_for_edge()\n"); | |
int fd = fd_lookup(gpio); | |
int epfd, n, i; | |
struct epoll_event events, ev; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@LudovicGuerra To test, I modified source/event_gpio.c in order to gain insight into what is happening.
Here is the test program
test-issue-134.py
based on your program above:I run the program with P8_16 disconnected and then I connect wire to 3.3V:
Do you get these same results?