Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to raspberry-gpio-python version 0.7. #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

francois2metz
Copy link

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!

@rojosinalma
Copy link

Can confirm this works for Rpi 3 and 4

cc @ClockVapor

@htrung1303
Copy link

Confirm this works for RPi 3B+ with Ruby 3.0.0.
Many thanks @francois2metz

@PhilipBotha
Copy link

Can confirm works on RPi B with Ruby 2.5.0 installed from buster repository.

@synthead
Copy link

synthead commented Nov 28, 2021

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"

@thomaswitt
Copy link

Same problem here like @synthead

@PhilipBotha
Copy link

PhilipBotha commented Feb 17, 2023

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants