16
16
17
17
LOG_MODULE_DECLARE (zmk , CONFIG_ZMK_LOG_LEVEL );
18
18
19
- static zmk_hid_indicators hid_indicators [ZMK_ENDPOINT_COUNT ];
19
+ static zmk_hid_indicators_t hid_indicators [ZMK_ENDPOINT_COUNT ];
20
20
21
- zmk_hid_indicators zmk_hid_indicators_get_current_profile (void ) {
21
+ zmk_hid_indicators_t zmk_hid_indicators_get_current_profile (void ) {
22
22
return zmk_hid_indicators_get_profile (zmk_endpoints_selected ());
23
23
}
24
24
25
- zmk_hid_indicators zmk_hid_indicators_get_profile (struct zmk_endpoint_instance endpoint ) {
26
- int profile = zmk_endpoint_instance_to_index (endpoint );
25
+ zmk_hid_indicators_t zmk_hid_indicators_get_profile (struct zmk_endpoint_instance endpoint ) {
26
+ const int profile = zmk_endpoint_instance_to_index (endpoint );
27
27
return hid_indicators [profile ];
28
28
}
29
29
30
30
static void raise_led_changed_event (struct k_work * _work ) {
31
- zmk_hid_indicators indicators = zmk_hid_indicators_get_current_profile ();
31
+ const zmk_hid_indicators_t indicators = zmk_hid_indicators_get_current_profile ();
32
32
33
33
ZMK_EVENT_RAISE (new_zmk_hid_indicators_changed (
34
34
(struct zmk_hid_indicators_changed ){.indicators = indicators }));
@@ -40,7 +40,7 @@ static void raise_led_changed_event(struct k_work *_work) {
40
40
41
41
static K_WORK_DEFINE (led_changed_work , raise_led_changed_event ) ;
42
42
43
- void zmk_hid_indicators_set_profile (zmk_hid_indicators indicators ,
43
+ void zmk_hid_indicators_set_profile (zmk_hid_indicators_t indicators ,
44
44
struct zmk_endpoint_instance endpoint ) {
45
45
int profile = zmk_endpoint_instance_to_index (endpoint );
46
46
@@ -54,7 +54,7 @@ void zmk_hid_indicators_set_profile(zmk_hid_indicators indicators,
54
54
55
55
void zmk_hid_indicators_process_report (struct zmk_hid_led_report_body * report ,
56
56
struct zmk_endpoint_instance endpoint ) {
57
- uint8_t indicators = report -> leds ;
57
+ const zmk_hid_indicators_t indicators = ( zmk_hid_indicators_t ) report -> leds ;
58
58
zmk_hid_indicators_set_profile (indicators , endpoint );
59
59
60
60
LOG_DBG ("Update HID indicators: endpoint=%d, indicators=%x" , endpoint .transport , indicators );
0 commit comments