Skip to content

Commit 2397c45

Browse files
cmagliefacchinm
authored andcommitted
fixed indent and slightly simplified ifdef
1 parent ba95a6a commit 2397c45

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

cores/arduino/USB/PluggableUSB.cpp

+11-15
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
#include "USBCore.h"
2323
#include "PluggableUSB.h"
2424

25-
#if defined(USBCON)
26-
#ifdef PLUGGABLE_USB_ENABLED
25+
#if defined(USBCON) && defined(PLUGGABLE_USB_ENABLED)
2726

2827
extern uint32_t EndPoints[];
2928

@@ -54,15 +53,15 @@ int PluggableUSB_::getDescriptor(USBSetup& setup)
5453

5554
uint8_t PluggableUSB_::getShortName(char *iSerialNum)
5655
{
57-
PluggableUSBModule* node;
58-
uint8_t size = 0;
59-
for (node = rootNode; node; node = node->next) {
60-
uint8_t len = node->getShortName(iSerialNum);
61-
iSerialNum += len;
62-
size += len;
63-
}
64-
*iSerialNum = 0;
65-
return size;
56+
PluggableUSBModule* node;
57+
uint8_t size = 0;
58+
for (node = rootNode; node; node = node->next) {
59+
uint8_t len = node->getShortName(iSerialNum);
60+
iSerialNum += len;
61+
size += len;
62+
}
63+
*iSerialNum = 0;
64+
return size;
6665
}
6766

6867
bool PluggableUSB_::setup(USBSetup& setup)
@@ -117,12 +116,9 @@ PluggableUSB_& PluggableUSB()
117116
return obj;
118117
}
119118

120-
PluggableUSB_::PluggableUSB_() : lastIf(0),
121-
lastEp(1),
122-
rootNode(NULL)
119+
PluggableUSB_::PluggableUSB_() : lastIf(0), lastEp(1), rootNode(NULL)
123120
{
124121
// Empty
125122
}
126123

127-
#endif
128124
#endif

0 commit comments

Comments
 (0)