Skip to content

Commit ca26e57

Browse files
committed
Added missing #defines to the comments in EButton.h and the keywords.txt files. Added CAVEAT section to README.md
1 parent 776a781 commit ca26e57

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

EButton.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* EButton v1.2.0 - Customizable button-driver class with a small footprint, supporting debouncing, and various events.
2+
* EButton v1.2.1 - Customizable button-driver class with a small footprint, supporting debouncing, and various events.
33
*
44
* Its already small footprint can be additionally minimized by disabling unneeded features using #define switches.
55
*
@@ -29,9 +29,9 @@
2929
* allowing you to read details about the event, like a number of clicks, time of the first click, etc.
3030
*
3131
*
32-
* Version: 1.2.0
32+
* Version: 1.2.1
3333
* License: MIT
34-
* Created on: 2017-02-27
34+
* Created on: 2022-01-02
3535
* Author: JonnieZG
3636
*/
3737

@@ -51,7 +51,7 @@
5151
//#define EBUTTON_SUPPORT_SINGLE_AND_DOUBLE_CLICKS_DISABLED
5252
//#define EBUTTON_SUPPORT_LONG_PRESS_START_DISABLED
5353
//#define EBUTTON_SUPPORT_LONG_PRESS_DURING_DISABLED
54-
54+
//#define EBUTTON_SUPPORT_LONG_PRESS_END_DISABLED
5555

5656
#ifndef EBUTTON_SUPPORT_TRANSITION_DISABLED
5757
#define EBUTTON_SUPPORT_TRANSITION

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ and don't forget to clean the project after making such a change:
133133
> Another way of getting a small footprint in simple cases where you just need to **detect each click, regardless their count**, is to
134134
> disable all features except the `EBUTTON_SUPPORT_EACH_CLICK`.
135135
136+
> **CAVEAT:** In some assemblers you might get unwanted results and crashes when using a `DISABLED` define, due to the
137+
badly implemented
138+
> include/compiling order. If you experience unexplicable crashes and strange behavior, try removing all the `DISABLED` defines
139+
> and recompile the code.
140+
136141
## Debouncing
137142
Due to imperfections of electrical contacts, in most buttons and switches, the state does not just go from one state to another and
138143
stays there. Instead, there is always a certain period (depending on the actual switch, between a few and several dozens of milliseconds),
@@ -352,3 +357,4 @@ void loop() {
352357
* `1.0.0 (2017-02-18)`: Original release
353358
* `1.1.0 (2017-02-23)`: Discrete enabling/disabling START, DURING and END support for LONG_PRESS
354359
* `1.2.0 (2019-07-26)`: Changed way of disabling features, to allow specific per-project settings, without having to change the EButton.h file
360+
* `1.2.1 (2022-02-01)`: Added missing #defines to the comments in EButton.h and the keywords.txt files

keywords.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,24 @@ getLastTransitionTime KEYWORD2
3838
EBUTTON_DEFAULT_DEBOUNCE LITERAL1
3939
EBUTTON_DEFAULT_CLICK LITERAL1
4040
EBUTTON_DEFAULT_LONG_PRESS LITERAL1
41+
42+
EBUTTON_STATE_IDLE LITERAL1
43+
EBUTTON_STATE_COUNTING_CLICKS_DOWN LITERAL1
44+
EBUTTON_STATE_COUNTING_CLICKS_UP LITERAL1
45+
EBUTTON_STATE_LONG_PRESSED LITERAL1
46+
47+
EBUTTON_SUPPORT_TRANSITION_DISABLED LITERAL1
48+
EBUTTON_SUPPORT_EACH_CLICK_DISABLED LITERAL1
49+
EBUTTON_SUPPORT_DONE_CLICKING_DISABLED LITERAL1
50+
EBUTTON_SUPPORT_SINGLE_AND_DOUBLE_CLICKS_DISABLED LITERAL1
51+
EBUTTON_SUPPORT_LONG_PRESS_START_DISABLED LITERAL1
52+
EBUTTON_SUPPORT_LONG_PRESS_DURING_DISABLED LITERAL1
53+
EBUTTON_SUPPORT_LONG_PRESS_END_DISABLED LITERAL1
54+
4155
EBUTTON_SUPPORT_TRANSITION LITERAL1
4256
EBUTTON_SUPPORT_EACH_CLICK LITERAL1
43-
EBUTTON_SUPPORT_ANY_CLICK LITERAL1
57+
EBUTTON_SUPPORT_DONE_CLICKING LITERAL1
4458
EBUTTON_SUPPORT_SINGLE_AND_DOUBLE_CLICKS LITERAL1
45-
EBUTTON_SUPPORT_LONG_PRESS LITERAL1
46-
47-
59+
EBUTTON_SUPPORT_LONG_PRESS_START LITERAL1
60+
EBUTTON_SUPPORT_LONG_PRESS_DURING LITERAL1
61+
EBUTTON_SUPPORT_LONG_PRESS_END LITERAL1

0 commit comments

Comments
 (0)