Fix docs and also free the timer
This commit is contained in:
parent
a6d3e4b822
commit
cbcedbc6ab
|
@ -187,6 +187,12 @@ static int lrotary_close( lua_State* L )
|
|||
|
||||
d->handle = NULL;
|
||||
}
|
||||
|
||||
if (d->timer_handle) {
|
||||
esp_timer_stop(d->timer_handle);
|
||||
esp_timer_delete(d->timer_handle);
|
||||
d->timer_handle = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ Sets a callback on specific events.
|
|||
`switch:on(eventtype[, callback])`
|
||||
|
||||
#### Parameters
|
||||
- `eventtype` This defines the type of event being registered. This is the logical or of one or more of `PRESS`, `LONGPRESS`, `RELEASE`, `TURN`, `CLICK` or `DBLCLICK`.
|
||||
- `eventtype` This defines the type of event being registered. This is the logical or of one or more of `PRESS`, `LONGPRESS`, `RELEASE`, `TURN`, `CLICK` or `DBLCLICK`. `ALL` can be used as shorthand for all event types.
|
||||
- `callback` This is a function that will be invoked when the specified event happens.
|
||||
|
||||
If the callback is None or omitted, then the registration is cancelled.
|
||||
|
|
Loading…
Reference in New Issue