MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / attachButtonsToInterrupt

Method attachButtonsToInterrupt

src/Hal/ButtonDrv.cpp:265–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 *****************************************************************************/
264
265void ButtonDrv::attachButtonsToInterrupt()
266{
267 uint8_t buttonIdx = 0U;
268
269 /* The ISR shall notify about on change to determine whether the
270 * pin state is stable or not.
271 */
272 while (BUTTON_ID_CNT > buttonIdx)
273 {
274 if (IoPin::NC != BUTTON_PIN[buttonIdx]->getPinNo())
275 {
276 attachInterruptArg(BUTTON_PIN[buttonIdx]->getPinNo(),
277 isrButton,
278 &gButtonId[buttonIdx],
279 CHANGE);
280
281 /* Start the debouncing to get a stable initial button state. */
282 m_timer[buttonIdx].start(DEBOUNCING_TIME);
283 }
284
285 ++buttonIdx;
286 }
287}
288
289void ButtonDrv::setState(ButtonId buttonId, ButtonState state)
290{

Callers

nothing calls this directly

Calls 2

getPinNoMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected