Fix docs and also free the timer

This commit is contained in:
Philip Gladstone 2024-02-04 12:47:10 -05:00
parent a6d3e4b822
commit cbcedbc6ab
2 changed files with 7 additions and 1 deletions

View File

@ -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;
}

View File

@ -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.