diff options
Diffstat (limited to 'tmk_core/common/host.c')
-rw-r--r-- | tmk_core/common/host.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c index f0c396b189..56d4bb0847 100644 --- a/tmk_core/common/host.c +++ b/tmk_core/common/host.c @@ -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; } |