fixup/test compiler warnings

This commit is contained in:
graham sanderson
2021-05-24 12:17:14 -05:00
committed by Graham Sanderson
parent 4f64f3af80
commit 7e4e3290d5
10 changed files with 23 additions and 8 deletions

View File

@@ -134,7 +134,7 @@ void hid_task(void) {
static bool has_key = false;
static bool toggle = false;
if (toggle = !toggle) {
if ((toggle = !toggle)) {
uint8_t keycode[6] = {0};
keycode[0] = HID_KEY_A;

View File

@@ -113,7 +113,7 @@ struct usb_endpoint_configuration *usb_get_endpoint_configuration(uint8_t addr)
*/
uint8_t usb_prepare_string_descriptor(const unsigned char *str) {
// 2 for bLength + bDescriptorType + strlen * 2 because string is unicode. i.e. other byte will be 0
uint8_t bLength = 2 + (strlen(str) * 2);
uint8_t bLength = 2 + (strlen((const char *)str) * 2);
static const uint8_t bDescriptorType = 0x03;
volatile uint8_t *buf = &ep0_buf[0];

View File

@@ -129,8 +129,8 @@ static const unsigned char lang_descriptor[] = {
};
static const unsigned char *descriptor_strings[] = {
"Raspberry Pi", // Vendor
"Pico Test Device" // Product
(unsigned char *) "Raspberry Pi", // Vendor
(unsigned char *) "Pico Test Device" // Product
};
#endif