rpi_gpio
rpi_gpio copied to clipboard
Update to raspberry-gpio-python version 0.7.
Hi,
I updated the extension to the latest version of raspberry-gpio-python. It fixes a bug with the raspberry pi 4 (See there: https://sourceforge.net/p/raspberry-gpio-python/code/ci/5021b32713c453cccfa17edc15bfeb85f6dca074/)
I tested it and it works!
Can confirm this works for Rpi 3 and 4
cc @ClockVapor
Confirm this works for RPi 3B+ with Ruby 3.0.0. Many thanks @francois2metz
Can confirm works on RPi B with Ruby 2.5.0 installed from buster repository.
I'm running into this compilation error with your fork: gem_make.out.txt
To reproduce this, put this in a Gemfile and run bundle:
source "https://rubygems.org"
gem "rpi_gpio", github: "francois2metz/rpi_gpio", branch: "update-raspi4"
Same problem here like @synthead
I'm running into this compilation error with your fork: gem_make.out.txt
To reproduce this, put this in a
Gemfileand runbundle:source "https://rubygems.org" gem "rpi_gpio", github: "francois2metz/rpi_gpio", branch: "update-raspi4"
Same problem here like @synthead
The issue seem to stem from some of the variable definitions being made in common.h. The variables should be declared with the extern keyword in the header file and only defined in the source (c) file.
The header files are also missing include guards which can be problematic. Should not be an issue in this gem.
Update: The multiple definition of threads is proving tricky as it isn't immediately obvious if they are supposed to be the same global variable, or two separate variables. An additional complication is a shadow variable declared in the add_edge_detect function in event_gpio.c file.
Update:
I've made a fork where I've attempted a fix. I've removed the global threads definitions and am only using local stack variables as the thread ID that would be stored in the variable is never used.
This is untested. Will update this comment if/when I've tested it.
Update: I see @synthead Has a branch based on 0.5.0 that should work. Based on version 0.5.0. So should most likely be preferred. Still has the redundant threads variable though. See: https://github.com/synthead/rpi_gpio/tree/use-externs-in-common.h