MCPcopy Create free account
hub / github.com/OpenStickCommunity/GP2040-CE / getEncoderIndexByPin

Method getEncoderIndexByPin

src/addons/rotaryencoder.cpp:224–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224int8_t RotaryEncoderInput::getEncoderIndexByPin(uint8_t pin) {
225 for (uint8_t i = 0; i < MAX_ENCODERS; i++) {
226 if (encoderMap[i].enabled && ((encoderMap[i].pinA != -1) && (encoderMap[i].pinB != -1))) {
227 if ((encoderMap[i].pinA == pin) || (encoderMap[i].pinB == pin)) return pin;
228 }
229 }
230 return -1;
231}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected