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 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 | ||
32 | static host_driver_t *driver; | 32 | static host_driver_t *driver; |
33 | static uint16_t last_system_report = 0; | 33 | static uint16_t last_system_report = 0; |
34 | static uint16_t last_consumer_report = 0; | 34 | static uint16_t last_consumer_report = 0; |
35 | static uint32_t last_programmable_button_report = 0; | ||
35 | 36 | ||
36 | void host_set_driver(host_driver_t *d) { driver = d; } | 37 | void 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 | ||
126 | void 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 | |||
125 | uint16_t host_last_system_report(void) { return last_system_report; } | 134 | uint16_t host_last_system_report(void) { return last_system_report; } |
126 | 135 | ||
127 | uint16_t host_last_consumer_report(void) { return last_consumer_report; } | 136 | uint16_t host_last_consumer_report(void) { return last_consumer_report; } |
137 | |||
138 | uint32_t host_last_programmable_button_report(void) { return last_programmable_button_report; } | ||