From 3cd69ff4ae7aee2ffd7ab41686e3ad1d35ecadd4 Mon Sep 17 00:00:00 2001 From: Bernd Porr Date: Sat, 10 Apr 2021 23:05:08 +0100 Subject: [PATCH 1/2] 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. --- pigpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pigpio.c b/pigpio.c index 97bfc54b..d89295ac 100644 --- a/pigpio.c +++ b/pigpio.c @@ -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; From de6064cee916de96ec722988806a8d617df6d14c Mon Sep 17 00:00:00 2001 From: Bernd Porr Date: Sat, 10 Apr 2021 23:25:02 +0100 Subject: [PATCH 2/2] Fixed doc that set_PWM_range() returns the actual range Fixed the documentation that the command set_PWM_range() actually returns the actual range. This resolves #453. --- pigpiod_if2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pigpiod_if2.h b/pigpiod_if2.h index b6aa6486..ab32573b 100644 --- a/pigpiod_if2.h +++ b/pigpiod_if2.h @@ -592,8 +592,8 @@ user_gpio: 0-31. range: 25-40000. . . -Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_BAD_DUTYRANGE, -or PI_NOT_PERMITTED. +Returns the actual range for the current gpio frequency if OK, +otherwise PI_BAD_USER_GPIO, PI_BAD_DUTYRANGE, or PI_NOT_PERMITTED. Notes