Review comments. Also ensure that we have GPIO if we have ROTARY.
This commit is contained in:
parent
82b4c81484
commit
39c95722e3
|
@ -228,6 +228,7 @@ menu "NodeMCU modules"
|
||||||
config NODEMCU_CMODULE_ROTARY
|
config NODEMCU_CMODULE_ROTARY
|
||||||
bool "Rotary switch input device"
|
bool "Rotary switch input device"
|
||||||
default "n"
|
default "n"
|
||||||
|
select NODEMCU_CMODULE_GPIO
|
||||||
help
|
help
|
||||||
Includes the rotary module which allows easy access to one or more rotary switches.
|
Includes the rotary module which allows easy access to one or more rotary switches.
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,6 @@ static bool lrotary_dequeue_single(lua_State* L, DATA *d)
|
||||||
bool something_pending = false;
|
bool something_pending = false;
|
||||||
|
|
||||||
if (d) {
|
if (d) {
|
||||||
// This chnnel is open
|
|
||||||
rotary_event_t result;
|
rotary_event_t result;
|
||||||
|
|
||||||
if (rotary_getevent(d->handle, &result)) {
|
if (rotary_getevent(d->handle, &result)) {
|
||||||
|
|
|
@ -80,8 +80,8 @@ Events will be delivered in order, but there may be missing TURN events. If ther
|
||||||
queue of events, then PRESS and RELEASE events may also be missed. Multiple pending TURN events
|
queue of events, then PRESS and RELEASE events may also be missed. Multiple pending TURN events
|
||||||
are typically dispatched as one TURN callback with the final position as its parameter.
|
are typically dispatched as one TURN callback with the final position as its parameter.
|
||||||
|
|
||||||
Some switches have 4 steps per detent. This means that, in practice, the application
|
Some switches have 4 (or 2) steps per detent. This means that, in practice, the application
|
||||||
should divide the position by 4 and use that to determine the number of clicks. It is
|
should divide the position by 4 (or 2) and use that to determine the number of clicks. It is
|
||||||
unlikely that a switch will ever reach 30 bits of rotation in either direction -- some
|
unlikely that a switch will ever reach 30 bits of rotation in either direction -- some
|
||||||
are rated for under 50,000 revolutions.
|
are rated for under 50,000 revolutions.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue