mirror of https://github.com/joan2937/pigpio
Fix issue#397 gpioSetTimerFunc NULL cancel error
This commit is contained in:
parent
55608548fc
commit
2220e497bd
7
pigpio.c
7
pigpio.c
|
@ -12488,8 +12488,11 @@ int gpioSetTimerFunc(unsigned id, unsigned millis, gpioTimerFunc_t f)
|
|||
if (id > PI_MAX_TIMER)
|
||||
SOFT_ERROR(PI_BAD_TIMER, "bad timer id (%d)", id);
|
||||
|
||||
if ((millis < PI_MIN_MS) || (millis > PI_MAX_MS))
|
||||
SOFT_ERROR(PI_BAD_MS, "timer %d, bad millis (%d)", id, millis);
|
||||
if (f)
|
||||
{
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue