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:
Bernd Porr 2021-04-10 23:05:08 +01:00
parent b7cdaceef3
commit 3cd69ff4ae
1 changed files with 1 additions and 0 deletions

View File

@ -14023,6 +14023,7 @@ uint32_t gpioCfgGetInternals(void)
int gpioCfgSetInternals(uint32_t cfgVal)
{
if (libInitialised) return PI_INITIALISED;
gpioCfg.internals = cfgVal;
gpioCfg.dbgLevel = cfgVal & 0xF;
gpioCfg.alertFreq = (cfgVal>>4) & 0xF;