mirror of https://github.com/joan2937/pigpio
gpioCfgSetInternals now returns PI_INITIALISED after gpioInitialise
This resolves #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.
This commit is contained in:
parent
b7cdaceef3
commit
3cd69ff4ae
1
pigpio.c
1
pigpio.c
|
@ -14023,6 +14023,7 @@ uint32_t gpioCfgGetInternals(void)
|
||||||
|
|
||||||
int gpioCfgSetInternals(uint32_t cfgVal)
|
int gpioCfgSetInternals(uint32_t cfgVal)
|
||||||
{
|
{
|
||||||
|
if (libInitialised) return PI_INITIALISED;
|
||||||
gpioCfg.internals = cfgVal;
|
gpioCfg.internals = cfgVal;
|
||||||
gpioCfg.dbgLevel = cfgVal & 0xF;
|
gpioCfg.dbgLevel = cfgVal & 0xF;
|
||||||
gpioCfg.alertFreq = (cfgVal>>4) & 0xF;
|
gpioCfg.alertFreq = (cfgVal>>4) & 0xF;
|
||||||
|
|
Loading…
Reference in New Issue