25 #ifndef ACE_BUTTON_BUTTON_CONFIG_H
26 #define ACE_BUTTON_BUTTON_CONFIG_H
29 #include "IEventHandler.h"
32 #if defined(__GNUC__) || defined(__clang__)
33 #define ACE_BUTTON_DEPRECATED __attribute__((deprecated))
34 #elif defined(_MSC_VER)
35 #define ACE_BUTTON_DEPRECATED __declspec(deprecated)
37 #pragma message("WARNING: Implement ACE_BUTTON_DEPRECATED for this compiler")
38 #define ACE_BUTTON_DEPRECATED
41 namespace ace_button {
183 uint8_t buttonState);
188 #if ! defined(ARDUINO_ARCH_AVR)
232 return mDoubleClickDelay;
237 return mLongPressDelay;
247 return mRepeatPressDelay;
252 return mRepeatPressInterval;
257 return mHeartBeatInterval;
262 mDebounceDelay = debounceDelay;
267 mClickDelay = clickDelay;
272 mDoubleClickDelay = doubleClickDelay;
277 mLongPressDelay = longPressDelay;
282 mRepeatPressDelay = repeatPressDelay;
287 mRepeatPressInterval = repeatPressInterval;
292 mHeartBeatInterval = heartBeatInterval;
307 virtual unsigned long getClock() {
return millis(); }
318 return digitalRead(pin);
326 return mFeatureFlags & features;
331 mFeatureFlags |= features;
336 mFeatureFlags &= ~features;
371 uint8_t buttonState)
const {
373 if (! mEventHandler)
return;
378 eventHandler->
handleEvent(button, eventType, buttonState);
382 eventHandler(button, eventType, buttonState);
391 mEventHandler =
reinterpret_cast<void*
>(eventHandler);
400 mEventHandler = eventHandler;
409 return &sSystemButtonConfig;
428 void* mEventHandler =
nullptr;