Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
avandalen authored Jul 14, 2021
1 parent 0edf680 commit f7f6a29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions avdweb_Switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ WEBSITE: http://www.avdweb.nl/arduino/hardware-interfacing/simple-switch-debounc
1.2.1 30-11-2018 bugfix. Initialize time variables in the constructor. Fixes false event if first call to poll was delayed
1.2.2 18-10-2019 beep when a switch is pressed with using a setBeepAllCallback function
1.2.3 03-04-2020 made public: deglitchPeriod, debouncePeriod, longPressPeriod, doubleClickPeriod
1.2.4 14-07-2021 "static switchCallback_t _beepAllCallback = nullptr;" gives error with SAMD21, removed "= nullptr;"
..........................................DEGLITCHING..............................
Expand Down
6 changes: 4 additions & 2 deletions avdweb_Switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ class Switch
switchCallback_t _longPressCallback = nullptr;
switchCallback_t _doubleClickCallback = nullptr;
switchCallback_t _singleClickCallback = nullptr;
static switchCallback_t _beepAllCallback = nullptr; // static function pointer, can be used by all objects
static switchCallback_t _beepAllCallback; // static function pointer, can be used by all objects
//static switchCallback_t _beepAllCallback = nullptr; // gives error with SAMD21
//static void(*_beepAllCallback)(void*) = nullptr; // static function pointer without typedef

void* _pushedCallbackParam = nullptr;
void* _releasedCallbackParam = nullptr;
void* _longPressCallbackParam = nullptr;
void* _doubleClickCallbackParam = nullptr;
void* _singleClickCallbackParam = nullptr;
static void* _beepAllCallbackParam = nullptr; // can be used by all objects
static void* _beepAllCallbackParam; // can be used by all objects
//static void* _beepAllCallbackParam = nullptr; // gives error with SAMD21
};
#endif

0 comments on commit f7f6a29

Please sign in to comment.