| 263 | *****************************************************************************/ |
| 264 | |
| 265 | void 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 | |
| 289 | void ButtonDrv::setState(ButtonId buttonId, ButtonState state) |
| 290 | { |