|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|


Go to the source code of this file.
Functions | |
| static bool | GetKeyState (void) |
| Returns the current state of the Pushbutton Key. More... | |
| static void | KeyInt (void) |
| Must be called from the 100Hz-Timer Interrupt. More... | |
Variables | |
| static const uint8_t | KFLAG_KEYPRESSED =1 |
| The key has been pressed. More... | |
| static const uint8_t | KFLAG_KEYPRESSEDLONG =8 |
| The key has been pressed for more than 2 seconds. More... | |
| static const uint8_t | KFLAG_KEYPRESSEDSHORT =4 |
| The key has been pressed and released within 2 seconds. More... | |
| static const uint8_t | KFLAG_KEYRELEASED =2 |
| The key has been released. More... | |
| volatile uint8_t | kflags |
| Flags set by KeyInt() for evaluation by the main loop. More... | |
|
inlinestatic |
Returns the current state of the Pushbutton Key.
Referenced by KeyInt().

|
inlinestatic |
Must be called from the 100Hz-Timer Interrupt.
kflags are set in the following order:
KEY_PRESSED as soon as a keypress is detected
KEY_PRESSEDSHORT the key has been released but has not been pressed for at least 2.5 seconds
KEY_PRESSEDLONG the Key is pressed for 2.5 seconds or more (but not necessarily released yet).
KEY_RELEASED when the key is released
Only the KEY_PRESSED and KEY_RELEASED events are immediate. The others are set after the key has been released or after 2.5 seconds.
The times have a granularity of 100ms (i.e. KEY_PRESSED may be detected 99ms after the key has really been pressed and the 2.5 seconds may have been 2.50 or 2.599 seconds) but that's absolutely o.k. for a UI.
References GetKeyState(), KFLAG_KEYPRESSED, KFLAG_KEYPRESSEDLONG, KFLAG_KEYPRESSEDSHORT, KFLAG_KEYRELEASED, and kflags.
Referenced by ISR().


|
static |
The key has been pressed.
Referenced by DoKFlags(), and KeyInt().
|
static |
The key has been pressed for more than 2 seconds.
Referenced by DoKFlags(), and KeyInt().
|
static |
The key has been pressed and released within 2 seconds.
Referenced by DoKFlags(), and KeyInt().
|
static |
The key has been released.
Referenced by DoKFlags(), KeyInt(), and WaitKeyBlinking().
| volatile uint8_t kflags |
Flags set by KeyInt() for evaluation by the main loop.
Referenced by DoKFlags(), KeyInt(), main(), and WaitKeyBlinking().
1.8.15