fix most warnings with rp2040 -wconversion
This commit is contained in:
		| @@ -153,7 +153,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) | ||||
|     const char* str = string_desc_arr[index]; | ||||
|  | ||||
|     // Cap at max char | ||||
|     chr_count = strlen(str); | ||||
|     chr_count = (uint8_t) strlen(str); | ||||
|     if ( chr_count > 31 ) chr_count = 31; | ||||
|  | ||||
|     // Convert ASCII string into UTF-16 | ||||
| @@ -164,7 +164,7 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) | ||||
|   } | ||||
|  | ||||
|   // first byte is length (including header), second byte is string type | ||||
|   _desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2); | ||||
|   _desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8 ) | (2*chr_count + 2)); | ||||
|  | ||||
|   return _desc_str; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach