Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.

Commit a38fdb5

Browse files
committed
Merge branch 'master' of github.com:adafruit/Adafruit_TinyUSB_ArduinoCore
2 parents 3b52737 + 9d2b7d6 commit a38fdb5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Adafruit_USBD_Device.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
212212

213213
constexpr static inline bool isInvalidUtf8Octet(uint8_t t) {
214214
// see bullets in https://tools.ietf.org/html/rfc3629#section-1
215-
return (t == 0xc0) || (t == 0xC1) || ((t >= 0xF5) && (t <= 0xFF));
215+
return (t == 0xc0) || (t == 0xC1) || (t >= 0xF5);
216216
}
217217

218218
//
@@ -248,7 +248,7 @@ static int8_t utf8Codepoint(const uint8_t *utf8, uint32_t *codepointp)
248248
const uint32_t CODEPOINT_HIGHEST_SURROGATE_HALF = 0xDFFF;
249249

250250
*codepointp = 0xFFFD; // always initialize output to known value ... 0xFFFD (REPLACEMENT CHARACTER) seems the natural choice
251-
int codepoint;
251+
uint32_t codepoint;
252252
int len;
253253

254254
// The upper bits define both the length of additional bytes for the multi-byte encoding,
@@ -290,7 +290,7 @@ static int8_t utf8Codepoint(const uint8_t *utf8, uint32_t *codepointp)
290290
}
291291

292292
// explicit validation to prevent overlong encodings
293-
if ( (len == 1) && ((codepoint < 0x000000) || (codepoint > 0x00007F))) {
293+
if ( (len == 1) && (codepoint > 0x00007F)) {
294294
return -1;
295295
} else if ((len == 2) && ((codepoint < 0x000080) || (codepoint > 0x0007FF))) {
296296
return -1;

tinyusb/src/class/hid/hid_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ TU_ATTR_WEAK bool tud_hid_set_idle_cb(uint8_t idle_rate);
264264
HID_LOGICAL_MAX ( 1 ) ,\
265265
HID_REPORT_COUNT ( 16 ) ,\
266266
HID_REPORT_SIZE ( 1 ) ,\
267-
HID_INPUT ( HID_DATA | HID_ARRAY | HID_ABSOLUTE ) ,\
267+
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
268268
/* X, Y, Z, Rz (min -127, max 127 ) */ \
269269
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\
270270
HID_LOGICAL_MIN ( 0x81 ) ,\

0 commit comments

Comments
 (0)