Add Support for USB programmable buttons (#12950)
This commit is contained in:
parent
1a68feb842
commit
83988597f4
22 changed files with 436 additions and 14 deletions
|
@ -30,8 +30,9 @@ extern keymap_config_t keymap_config;
|
|||
#endif
|
||||
|
||||
static host_driver_t *driver;
|
||||
static uint16_t last_system_report = 0;
|
||||
static uint16_t last_consumer_report = 0;
|
||||
static uint16_t last_system_report = 0;
|
||||
static uint16_t last_consumer_report = 0;
|
||||
static uint32_t last_programmable_button_report = 0;
|
||||
|
||||
void host_set_driver(host_driver_t *d) { driver = d; }
|
||||
|
||||
|
@ -122,6 +123,16 @@ void host_digitizer_send(digitizer_t *digitizer) {
|
|||
|
||||
__attribute__((weak)) void send_digitizer(report_digitizer_t *report) {}
|
||||
|
||||
void host_programmable_button_send(uint32_t report) {
|
||||
if (report == last_programmable_button_report) return;
|
||||
last_programmable_button_report = report;
|
||||
|
||||
if (!driver) return;
|
||||
(*driver->send_programmable_button)(report);
|
||||
}
|
||||
|
||||
uint16_t host_last_system_report(void) { return last_system_report; }
|
||||
|
||||
uint16_t host_last_consumer_report(void) { return last_consumer_report; }
|
||||
|
||||
uint32_t host_last_programmable_button_report(void) { return last_programmable_button_report; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue