Fix issue#397 gpioSetTimerFunc NULL cancel error

This commit is contained in:
Guy McSwain 2020-12-18 20:23:52 -06:00
parent 55608548fc
commit 2220e497bd
1 changed files with 5 additions and 2 deletions

View File

@ -12488,8 +12488,11 @@ int gpioSetTimerFunc(unsigned id, unsigned millis, gpioTimerFunc_t f)
if (id > PI_MAX_TIMER) if (id > PI_MAX_TIMER)
SOFT_ERROR(PI_BAD_TIMER, "bad timer id (%d)", id); SOFT_ERROR(PI_BAD_TIMER, "bad timer id (%d)", id);
if ((millis < PI_MIN_MS) || (millis > PI_MAX_MS)) if (f)
SOFT_ERROR(PI_BAD_MS, "timer %d, bad millis (%d)", id, millis); {
if ((millis < PI_MIN_MS) || (millis > PI_MAX_MS))
SOFT_ERROR(PI_BAD_MS, "timer %d, bad millis (%d)", id, millis);
}
intGpioSetTimerFunc(id, millis, f, 0, NULL); intGpioSetTimerFunc(id, millis, f, 0, NULL);