diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-09 00:05:39 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-09 00:05:39 -0700 |
commit | 8d9c79f5c162e07d57d42c6ba5825a3327a911d5 (patch) | |
tree | 3e97ed6affaa5f864522c4d73a80842f90a9599c /src/telelco-v0.2 | |
parent | ef48e1bb73c791d731b0d2c0e5beef1539103049 (diff) |
altos: Simplify quadrature tracking
Set the timer to 200Hz for a 5ms debounce interval. Then, simply look
for transitions ending in both bits in the encoder being off, which
indicates the the encoder is resting in a detent. If bit '2' is
turning off, the encoder was rotated clockwise, otherwise the encoder
was rotated counter clockwise.
This is a lot more reliable, although still not perfect.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/telelco-v0.2')
-rw-r--r-- | src/telelco-v0.2/ao_pins.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/telelco-v0.2/ao_pins.h b/src/telelco-v0.2/ao_pins.h index 62f221a1..609e5494 100644 --- a/src/telelco-v0.2/ao_pins.h +++ b/src/telelco-v0.2/ao_pins.h @@ -72,6 +72,8 @@ #define PACKET_HAS_SLAVE 0 #define PACKET_HAS_MASTER 0 +#define FAST_TIMER_FREQ 200 /* 5ms for debouncing */ + /* * Radio is a cc1120 connected via SPI */ |