We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f80361f commit 3ee886bCopy full SHA for 3ee886b
cores/arduino/USB/USBCore.cpp
@@ -391,9 +391,10 @@ uint32_t EndPoints[] =
391
0,
392
#endif
393
};
394
+#define EP_ARRAY_SIZE (sizeof(EndPoints)/sizeof(EndPoints[0]))
395
396
void USBDeviceClass::initEndpoints() {
- for (uint8_t i = 1; i < sizeof(EndPoints) && EndPoints[i] != 0; i++) {
397
+ for (uint8_t i = 1; (i < EP_ARRAY_SIZE) && (EndPoints[i] != 0); i++) {
398
initEP(i, EndPoints[i]);
399
}
400
0 commit comments