Skip to content

Commit d26aa1b

Browse files
authored
Merge pull request adafruit#89 from earlephilhower/examplesfix
Fix "-Wall -Wextra -Werror" warnings in examples
2 parents a6933ac + 455426e commit d26aa1b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

examples/Composite/hid_generic_inout_ramdisk/hid_generic_inout_ramdisk.ino

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ void loop()
8686
uint16_t get_report_callback (uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
8787
{
8888
// not used in this example
89+
(void) report_id;
90+
(void) report_type;
91+
(void) buffer;
92+
(void) reqlen;
8993
return 0;
9094
}
9195

examples/HID/hid_generic_inout/hid_generic_inout.ino

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ void loop()
6868
uint16_t get_report_callback (uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
6969
{
7070
// not used in this example
71+
(void) report_id;
72+
(void) report_type;
73+
(void) buffer;
74+
(void) reqlen;
7175
return 0;
7276
}
7377

examples/HID/hid_keyboard/hid_keyboard.ino

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/* This sketch demonstrates USB HID keyboard.
1515
* - PIN A0-A5 is used to send digit '0' to '5' respectively
16+
* (On the RP2040, pins D0-D5 used)
1617
* - LED will be used as Caplock indicator
1718
*/
1819

@@ -27,7 +28,11 @@ Adafruit_USBD_HID usb_hid;
2728

2829
// Array of pins and its keycode
2930
// For keycode definition see BLEHidGeneric.h
31+
#ifdef ARDUINO_ARCH_RP2040
32+
uint8_t pins[] = { D0, D1, D2, D3, D4, D5 };
33+
#else
3034
uint8_t pins[] = { A0, A1, A2, A3, A4, A5 };
35+
#endif
3136
uint8_t hidcode[] = { HID_KEY_0, HID_KEY_1, HID_KEY_2, HID_KEY_3 , HID_KEY_4, HID_KEY_5 };
3237

3338
uint8_t pincount = sizeof(pins)/sizeof(pins[0]);
@@ -122,6 +127,8 @@ void loop()
122127
// Output report callback for LED indicator such as Caplocks
123128
void hid_report_callback(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
124129
{
130+
(void) report_id;
131+
(void) bufsize;
125132
// LED indicator is output report with only 1 byte length
126133
if ( report_type != HID_REPORT_TYPE_OUTPUT ) return;
127134

0 commit comments

Comments
 (0)