Skip to content

Commit

Permalink
V0.8.6 : use with wiringPi version 3.16 from https://github.com/phyla…
Browse files Browse the repository at this point in the history
  • Loading branch information
phylax2020 committed Feb 20, 2025
1 parent 4965bd2 commit 9fab4cf
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change Log
==========
0.8.6
-----
Interrupt functions optimized >= 3.16

0.8.5
-----
Interrupt functions optimized >= 3.15
Expand Down
40 changes: 20 additions & 20 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ sudo apt purge wiringpi
# If returned aarch64 --> 64 Bit
#
# If 32 bit release Bookworm
wget https://github.com/phylax2020/WiringPi/releases/download/3.14/wiringpi_3.15_armhf.deb
sudo apt install ./wiringpi_3.15_armhf.deb
wget https://github.com/phylax2020/WiringPi/releases/download/3.16/wiringpi_3.16_armhf.deb
sudo apt install ./wiringpi_3.16_armhf.deb

# If 64 bit release Bookworm
wget https://github.com/phylax2020/WiringPi/releases/download/3.14/wiringpi_3.15_arm64.deb
sudo apt install ./wiringpi_3.15_arm64.deb
wget https://github.com/phylax2020/WiringPi/releases/download/3.16/wiringpi_3.16_arm64.deb
sudo apt install ./wiringpi_3.16_arm64.deb

# If you want to build your own version of WiringPi:

# update Pi-OS
sudo apt update
sudo apt upgrade

# install latest version (3.15) from source, it is a fork from https://github.com/WiringPi/WiringPi
# install latest version (3.16) from source, it is a fork from https://github.com/WiringPi/WiringPi
# Installing instructions can be found at https://github.com/phylax2020/WiringPi
# fetch the source
sudo apt install git
Expand All @@ -37,17 +37,17 @@ cd WiringPi
./build debian

# on Pi-OS 32 Bit:
mv debian-template/wiringpi_3.15_armhf.deb .
mv debian-template/wiringpi_3.16_armhf.deb .

# on Pi-OS 64 Bit
mv debian-template/wiringpi_3.15_arm64.deb .
mv debian-template/wiringpi_3.16_arm64.deb .

# install it
# on Pi-OS 32 Bit
sudo apt install ./wiringpi_3.15_armhf.deb
sudo apt install ./wiringpi_3.16_armhf.deb

# on Pi.OS 64 Bit
sudo apt install ./wiringpi_3.15_arm64.deb
sudo apt install ./wiringpi_3.16_arm64.deb

############################
# now install RPi.GPIO #
Expand All @@ -68,12 +68,12 @@ sudo pip3 uninstall RPi.GPIO --break-system-packages
# If returned aarch64 --> 64 Bit
#
# If 32 bit release Bookworm
wget https://github.com/phylax2020/RPi.GPIO/releases/download/v0.8.5/python3-rpi.gpio_0.8.5-1_armhf.deb
sudo apt install ./python3-rpi.gpio_0.8.5-1_armhf.deb
wget https://github.com/phylax2020/RPi.GPIO/releases/download/v0.8.6/python3-rpi.gpio_0.8.6-1_armhf.deb
sudo apt install ./python3-rpi.gpio_0.8.6-1_armhf.deb

# If 64 bit release Bookworm
wget https://github.com/phylax2020/RPi.GPIO/releases/download/v0.8.5/python3-rpi.gpio_0.8.5-1_arm64.deb
sudo apt install ./python3-rpi.gpio_0.8.5-1_arm64.deb
wget https://github.com/phylax2020/RPi.GPIO/releases/download/v0.8.6/python3-rpi.gpio_0.8.6-1_arm64.deb
sudo apt install ./python3-rpi.gpio_0.8.6-1_arm64.deb

###################################
# install from source #
Expand All @@ -88,7 +88,7 @@ sudo apt install python3-dev
# Install python3 build package
sudo apt install python3-build

# If you want install python3-rpi.gpio_0.8.5-1_arm<hf/64>.deb from source
# If you want install python3-rpi.gpio_0.8.6-1_arm<hf/64>.deb from source
# install stdeb and dependencies
sudo apt install python3-stdeb
sudo apt install dh-python
Expand All @@ -101,18 +101,18 @@ git clone https://github.com/phylax2020/RPi.GPIO.git
cd RPi.GPIO
python3 setup.py --command-packages=stdeb.command bdist_deb
cd deb_dist
sudo apt install ./python3-rpi.gpio_0.8.5-1_arm<hf/64>.deb
sudo apt install ./python3-rpi.gpio_0.8.6-1_arm<hf/64>.deb


# alternatively install RPi.GPIO using pip
# get assets RPi.GPIO-0.8.5.tar.gz or RPi.GPIO-0.8.5.zip from https://github.com/phylax2020/RPi.GPIO/archive/refs/tags/v0.8.5
# get assets RPi.GPIO-0.8.6.tar.gz or RPi.GPIO-0.8.6.zip from https://github.com/phylax2020/RPi.GPIO/archive/refs/tags/v0.8.6
cd ~
wget https://github.com/phylax2020/RPi.GPIO/archive/refs/tags/v0.8.5.tar.gz
tar -xvf v0.8.5.tar.gz
cd RPi.GPIO-0.8.5
wget https://github.com/phylax2020/RPi.GPIO/archive/refs/tags/v0.8.6.tar.gz
tar -xvf v0.8.6.tar.gz
cd RPi.GPIO-0.8.6
python3 -m build --sdist
cd dist
sudo pip3 install rpi_gpio-0.8.5.tar.gz --break-system-packages
sudo pip3 install rpi_gpio-0.8.6.tar.gz --break-system-packages

##########################
# test installation #
Expand Down
4 changes: 4 additions & 0 deletions PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Description: This package provides a Python module to control the GPIO on a Rasp

Change Log
==========
0.8.6
-----
Interrupt functions optimized >= 3.16

0.8.5
-----
Interrupt functions optimized >= 3.15
Expand Down
2 changes: 1 addition & 1 deletion RPi/GPIO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

from RPi._GPIO import *

VERSION = '0.8.5'
VERSION = '0.8.6'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'Topic :: System :: Hardware']

setup(name = 'RPi.GPIO',
version = '0.8.5',
version = '0.8.6',
author = 'Ben Croston',
author_email = 'ben@croston.org',
description = 'A module to control Raspberry Pi GPIO channels',
Expand Down
17 changes: 11 additions & 6 deletions source/py_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,11 +630,16 @@ static unsigned int chan_from_gpio(unsigned int gpio)
return -1;
}

static void run_py_callbacks(unsigned int gpio, long long int timestamp)
static void run_py_callbacks(struct WPIWfiStatus wfiStatus)
{
PyObject *result;
PyGILState_STATE gstate;
struct py_callback *cb = py_callbacks;
unsigned int gpio;
long long int timestamp;

gpio = wfiStatus.gpioPin;
timestamp = wfiStatus.timeStamp_us;

piLock (IRQ_KEY) ;
while (cb != NULL)
Expand Down Expand Up @@ -910,7 +915,7 @@ static PyObject *py_wait_for_edge(PyObject *self, PyObject *args, PyObject *kwar
int bouncetime = 0; // None
int timeout = -1; // None
int wiringPi_edge;
long long int result;
struct WPIWfiStatus wfiStatus;

static char *kwlist[] = {"channel", "edge", "bouncetime", "timeout", NULL};

Expand Down Expand Up @@ -962,19 +967,19 @@ static PyObject *py_wait_for_edge(PyObject *self, PyObject *args, PyObject *kwar
else if (edge == FALLING_EDGE)
wiringPi_edge = RISING_EDGE;

result = waitForInterrupt(gpio, wiringPi_edge, timeout, bouncetime);
wfiStatus = waitForInterrupt(gpio, wiringPi_edge, timeout, bouncetime);

// waitForInterruptClose( gpio );

if (result < 0LL) {
if (wfiStatus.status < 0) {
PyErr_SetString(PyExc_RuntimeError, "Error waiting for edge");
return NULL;
}
else if (result == 0LL) { // timeout
else if (wfiStatus.status == 0) { // timeout
return Py_BuildValue(""); // return none
}
else {
return Py_BuildValue("i", gpio);
return Py_BuildValue("i", wfiStatus.gpioPin);
}

}
Expand Down

0 comments on commit 9fab4cf

Please sign in to comment.