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
According to the documentation https://github.com/joan2937/pigpio/blob/master/pigpio.h#L107
all gpioCfg functions return PI_INITIALISED after gpioInitialise() has been called but neither gpioCfgGetInternals nor gpioCfgSetInternals do it: https://github.com/joan2937/pigpio/blob/master/pigpio.c#L14019
gpioCfgGetInternals cannot return an error code as it returns an unsigned int.
gpioCfgSetInternals just returns always zero.
Perhaps just the doc could be updated or gpioCfgSetInternals could return an error if called after gpioInitialise?
The text was updated successfully, but these errors were encountered:
Your suggestions seem reasonable to me. Changing the API to match the doc is preferred as in this case nobody else appears to be using the return value.
A pull request is welcome with these expectations: If accepted I will merge to the develop branch as soon as I get around to it but it won't make it into master until the next release. I'm trying to limit releases to once or twice per year unless a critical issue comes up. If you pull from develop you'll be getting the latest version of pigpio. I've been pretty conservative by only placing changes in develop that are tested and on track for the next release.
berndporr
added a commit
to berndporr/pigpio
that referenced
this issue
Apr 10, 2021
This resolvesjoan2937#455 with the discussion with @guymcswain that
gpioCfgSetInternals() should return an error if gpioInitialise()
has been called previously to report that it's no longer possible,
for example, to disable signal handling. If successful it returns
0 as before. Tested it by calling gpioCfgSetInternals, gpioInitialise,
gpioCfgSetInternals and reports 0 and -32 which looks OK.
According to the documentation
https://github.com/joan2937/pigpio/blob/master/pigpio.h#L107
all gpioCfg functions return PI_INITIALISED after gpioInitialise() has been called but neither gpioCfgGetInternals nor gpioCfgSetInternals do it:
https://github.com/joan2937/pigpio/blob/master/pigpio.c#L14019
gpioCfgGetInternals cannot return an error code as it returns an unsigned int.
gpioCfgSetInternals just returns always zero.
Perhaps just the doc could be updated or gpioCfgSetInternals could return an error if called after gpioInitialise?
The text was updated successfully, but these errors were encountered: