You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MRAA driver's GPIO implementation hasn't seen many updates for years. While it doesn't work well with newer RPi4 (and above), it could still get updated to conform with other drivers' GPIO implementations. The following will allow for a more robust and less-specific implementation of Arduino wrappers for the MRAA lib:
cache the mraa::Gpio* instances
make GPIO member functions static
Solution
I'll submit a PR as a proposal. Basically, just
use a std::map<rf24_gpio_t, mraa::Gpio*> as a cache.
// WARNING: use of memory mapped file system is deprecated in MRAA lib
gpio_0->useMmap(true); // `false` (or just not calling `useMmap()`) uses default file system?
Additional context
I want this because I'm working to expose the GPIO and interrupt functions in the pyRF24 project, but the MRAA driver requires special context that seems unnecessary (in both RF24 lib and python bindings).
PS - I've already done much of this work in my CirquePinnacle lib, so it would be mostly copy-n-paste from there.
The text was updated successfully, but these errors were encountered:
The MRAA driver's GPIO implementation hasn't seen many updates for years. While it doesn't work well with newer RPi4 (and above), it could still get updated to conform with other drivers' GPIO implementations. The following will allow for a more robust and less-specific implementation of Arduino wrappers for the MRAA lib:
mraa::Gpio*
instancesGPIO
member functions staticSolution
I'll submit a PR as a proposal. Basically, just
std::map<rf24_gpio_t, mraa::Gpio*>
as a cache.RF24/utility/MRAA/gpio.h
Lines 29 to 33 in af7fbec
RF24/utility/MRAA/gpio.cpp
Line 24 in af7fbec
RF24/RF24.cpp
Lines 1033 to 1036 in af7fbec
RF24/RF24.h
Lines 130 to 132 in af7fbec
RF24/utility/MRAA/gpio.cpp
Lines 39 to 40 in af7fbec
Additional context
I want this because I'm working to expose the GPIO and interrupt functions in the pyRF24 project, but the MRAA driver requires special context that seems unnecessary (in both RF24 lib and python bindings).
PS - I've already done much of this work in my CirquePinnacle lib, so it would be mostly copy-n-paste from there.
The text was updated successfully, but these errors were encountered: