KBD: Add function to tell if number keys are pressed

replace/a75f05925def8864def8e879de84314fe000553d
Federico Amedeo Izzo 2020-12-23 11:05:59 +01:00
rodzic 7888a7e398
commit 1f4fba958b
2 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -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;
/**
* 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
* The maximum size of an event payload is 30 bits

Wyświetl plik

@ -432,6 +432,11 @@ bool _ui_drawLowBatteryScreen()
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)
{
// Check if battery has enough charge to operate