From f7f6a29465503820511415421caa41c584f31498 Mon Sep 17 00:00:00 2001 From: Albert van Dalen Date: Wed, 14 Jul 2021 11:35:17 +0200 Subject: [PATCH] Add files via upload --- avdweb_Switch.cpp | 1 + avdweb_Switch.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/avdweb_Switch.cpp b/avdweb_Switch.cpp index c5fd143..31c7a7b 100644 --- a/avdweb_Switch.cpp +++ b/avdweb_Switch.cpp @@ -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.............................. diff --git a/avdweb_Switch.h b/avdweb_Switch.h index 42eb267..e2a996f 100644 --- a/avdweb_Switch.h +++ b/avdweb_Switch.h @@ -58,7 +58,8 @@ 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; @@ -66,6 +67,7 @@ class Switch 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