Deluge Firmware 1.3.0
Build date: 2026.07.15
Loading...
Searching...
No Matches
deluge::hid::encoders::DetentedEncoder Class Reference

#include <encoders.h>

Public Member Functions

 DetentedEncoder (const DetentedEncoder &)=delete
DetentedEncoder & operator= (const DetentedEncoder &)=delete
void applyEdges (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 Attributes

int32_t edgeAccumulator = 0
 Accumulates A-pin edges until we have a full detent click. IRQ-only.
std::atomic_int32_t pos = 0
 Written by the IRQ (applyEdges), drained by the encoder task.

Detailed Description

Black function encoders (SCROLL_X/Y, TEMPO, SELECT) are detented. Two A-pin edges = one quadrature cycle = one detent click.

Member Function Documentation

◆ restore()

void deluge::hid::encoders::DetentedEncoder::restore ( int32_t val)
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.


The documentation for this class was generated from the following files:
  • src/deluge/hid/encoders.h
  • src/deluge/hid/encoders.cpp