kopia lustrzana https://github.com/OpenRTX/OpenRTX
KBD: Add function to tell if number keys are pressed
rodzic
7888a7e398
commit
1f4fba958b
|
@ -71,6 +71,12 @@ static const uint8_t kbd_num_keys = 29;
|
||||||
*/
|
*/
|
||||||
static const uint16_t kbd_long_interval = OS_CFG_TICK_RATE_HZ * 0.7;
|
static const uint16_t kbd_long_interval = OS_CFG_TICK_RATE_HZ * 0.7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mask for the numeric keys in a key map
|
||||||
|
* Numeric keys: bit0->bit9 = 0x1FF
|
||||||
|
*/
|
||||||
|
static const uint32_t kbd_num_mask = 0x1FF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure that represents a keyboard event payload
|
* Structure that represents a keyboard event payload
|
||||||
* The maximum size of an event payload is 30 bits
|
* The maximum size of an event payload is 30 bits
|
||||||
|
|
|
@ -432,6 +432,11 @@ bool _ui_drawLowBatteryScreen()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _kbd_number_pressed(kbd_msg_t msg)
|
||||||
|
{
|
||||||
|
return msg.keys & kbd_num_mask;
|
||||||
|
}
|
||||||
|
|
||||||
void ui_updateFSM(event_t event, bool *sync_rtx)
|
void ui_updateFSM(event_t event, bool *sync_rtx)
|
||||||
{
|
{
|
||||||
// Check if battery has enough charge to operate
|
// Check if battery has enough charge to operate
|
||||||
|
|
Ładowanie…
Reference in New Issue