Skip to content

Commit 18b5aff

Browse files
authored
Merge pull request #2759 from hjalleboii/master
Marked the keycode parameter of the keyboard_report functions as const since the functions don't modifies the value
2 parents ea64dd4 + b786d6f commit 18b5aff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/class/hid/hid_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ uint8_t tud_hid_n_get_protocol(uint8_t instance) {
134134
return _hidd_itf[instance].protocol_mode;
135135
}
136136

137-
bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, uint8_t keycode[6]) {
137+
bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, const uint8_t keycode[6]) {
138138
hid_keyboard_report_t report;
139139
report.modifier = modifier;
140140
report.reserved = 0;

src/class/hid/hid_device.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool tud_hid_n_report(uint8_t instance, uint8_t report_id, void const* report, u
6565

6666
// KEYBOARD: convenient helper to send keyboard report if application
6767
// use template layout report as defined by hid_keyboard_report_t
68-
bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, uint8_t keycode[6]);
68+
bool tud_hid_n_keyboard_report(uint8_t instance, uint8_t report_id, uint8_t modifier, const uint8_t keycode[6]);
6969

7070
// MOUSE: convenient helper to send mouse report if application
7171
// use template layout report as defined by hid_mouse_report_t
@@ -98,7 +98,7 @@ TU_ATTR_ALWAYS_INLINE static inline bool tud_hid_report(uint8_t report_id, void
9898
return tud_hid_n_report(0, report_id, report, len);
9999
}
100100

101-
TU_ATTR_ALWAYS_INLINE static inline bool tud_hid_keyboard_report(uint8_t report_id, uint8_t modifier, uint8_t keycode[6]) {
101+
TU_ATTR_ALWAYS_INLINE static inline bool tud_hid_keyboard_report(uint8_t report_id, uint8_t modifier, const uint8_t keycode[6]) {
102102
return tud_hid_n_keyboard_report(0, report_id, modifier, keycode);
103103
}
104104

0 commit comments

Comments
 (0)