MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / gpioIsrHandler

Method gpioIsrHandler

Drivers/ButtonControl/Source/ButtonControl.cpp:117–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void IRAM_ATTR ButtonControl::gpioIsrHandler(void* arg) {
118 auto* isrArg = static_cast<IsrArg*>(arg);
119 ButtonEvent event {
120 .pin = isrArg->pin,
121 .pressed = gpio_get_level(isrArg->pin) == 0, // active-low: LOW = pressed
122 };
123 // tt::MessageQueue::put() is ISR-safe with timeout=0: it detects ISR context via
124 // xPortInIsrContext() and uses xQueueSendFromISR() + portYIELD_FROM_ISR() internally.
125 isrArg->self->buttonQueue.put(&event, 0);
126}
127
128void ButtonControl::driverThreadMain() {
129 ButtonEvent event;

Callers

nothing calls this directly

Calls 1

putMethod · 0.80

Tested by

no test coverage detected