Modified version to work with EventQueue (outside of ISR)
Diff: MultiClick.cpp
- Revision:
- 2:6af39916a4a2
- Parent:
- 1:67d677ad73e7
- Child:
- 3:c7f97bebf2f7
--- a/MultiClick.cpp Mon Jun 13 08:30:29 2016 +0000 +++ b/MultiClick.cpp Mon Jun 13 09:11:53 2016 +0000 @@ -31,7 +31,7 @@ { // --- チャタリング(debounce)チェック ------------------------------------------------ if(_debounce_ignore == true) { - DBG_PRINT("bounce. "); + DBG_PRINT("isr_pressed: bounce. "); fflush(stdout); return; @@ -39,6 +39,21 @@ DBG_PRINT("isr_pressed called:\r\n"); fflush(stdout); } + +} + +void MultiClick::isr_released( void ) +{ + // --- チャタリング(debounce)チェック ------------------------------------------------ + if(_debounce_ignore == true) { + DBG_PRINT("isr_released: bounce. "); + fflush(stdout); + + return; + } else { + DBG_PRINT("isr_released called:\r\n"); + fflush(stdout); + } // クリック認定 _click_times++; @@ -73,10 +88,6 @@ _timeout->detach(); _timeout->attach_us(this, &MultiClick::click_timeout, _click_interval_us ); -} - -void MultiClick::isr_released( void ) -{ }