![]() |
Deluge Firmware 1.3.0
Build date: 2026.10.14
|
#include <encoders.h>
Public Member Functions | |
| DetentedEncoder (const DetentedEncoder &)=delete | |
| DetentedEncoder & | operator= (const DetentedEncoder &)=delete |
| void | apply_edges (int8_t edges) |
| bool | pending () const |
| True if any detent steps are waiting to be consumed. | |
| int32_t | take () |
| Returns the accumulated signed detent count and resets pos to 0. | |
| void | restore (int32_t val) |
Private Member Functions | |
| int32_t | positiveThreshold () const |
| int32_t | negativeThreshold () const |
Black function encoders (SCROLL_X/Y, TEMPO, SELECT) are detented. Four quadrature edges = one detent click. The decoder confirms each edge one edge late, so the first click needs three confirmed edges, continuing needs four, and a reversal needs two (the pending edge is retraced before reverse edges confirm). Partial reverse travel cancels on returning to the detent, without undoing the reported click or discarding forward progress.
|
inline |
Puts a value back (used by the SD card-routine retry path). fetch_add rather than store so a detent that arrived from the IRQ since take() isn't clobbered.