15 extern volatile uint8_t
kflags;
45 static bool lastKeyState=
false;
46 static uint8_t keyPressedTime=0;
47 static uint8_t cnt100ms=0;
60 if (lastKeyState!=keyState)
62 lastKeyState=keyState;
71 if (keyPressedTime<25)
78 if (keyPressedTime<255)
82 if (keyPressedTime==25)
static const uint8_t KFLAG_KEYPRESSED
The key has been pressed.
Definition: key.h:16
static void KeyInt(void)
Must be called from the 100Hz-Timer Interrupt.
Definition: key.h:43
static const uint8_t KFLAG_KEYPRESSEDSHORT
The key has been pressed and released within 2 seconds.
Definition: key.h:18
static const uint8_t KFLAG_KEYPRESSEDLONG
The key has been pressed for more than 2 seconds.
Definition: key.h:19
volatile uint8_t kflags
Flags set by KeyInt() for evaluation by the main loop.
Definition: key.c:24
static bool GetKeyState(void)
Returns the current state of the Pushbutton Key.
Definition: key.h:24
static const uint8_t KFLAG_KEYRELEASED
The key has been released.
Definition: key.h:17