aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/host.c')
-rw-r--r--tmk_core/common/host.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c
index f0c396b18..56d4bb084 100644
--- a/tmk_core/common/host.c
+++ b/tmk_core/common/host.c
@@ -30,8 +30,9 @@ extern keymap_config_t keymap_config;
30#endif 30#endif
31 31
32static host_driver_t *driver; 32static host_driver_t *driver;
33static uint16_t last_system_report = 0; 33static uint16_t last_system_report = 0;
34static uint16_t last_consumer_report = 0; 34static uint16_t last_consumer_report = 0;
35static uint32_t last_programmable_button_report = 0;
35 36
36void host_set_driver(host_driver_t *d) { driver = d; } 37void host_set_driver(host_driver_t *d) { driver = d; }
37 38
@@ -122,6 +123,16 @@ void host_digitizer_send(digitizer_t *digitizer) {
122 123
123__attribute__((weak)) void send_digitizer(report_digitizer_t *report) {} 124__attribute__((weak)) void send_digitizer(report_digitizer_t *report) {}
124 125
126void host_programmable_button_send(uint32_t report) {
127 if (report == last_programmable_button_report) return;
128 last_programmable_button_report = report;
129
130 if (!driver) return;
131 (*driver->send_programmable_button)(report);
132}
133
125uint16_t host_last_system_report(void) { return last_system_report; } 134uint16_t host_last_system_report(void) { return last_system_report; }
126 135
127uint16_t host_last_consumer_report(void) { return last_consumer_report; } 136uint16_t host_last_consumer_report(void) { return last_consumer_report; }
137
138uint32_t host_last_programmable_button_report(void) { return last_programmable_button_report; }