Skip to content

Commit d0a0b06

Browse files
committed
Made USP-API included flexible
1 parent 60e64cf commit d0a0b06

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: hardware/arduino/avr/cores/arduino/USBAPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class USBDevice_
6767
bool wakeupHost(); // returns false, when wakeup cannot be processed
6868
};
6969
extern USBDevice_ USBDevice;
70+
void setupUSB();
7071

7172
//================================================================================
7273
//================================================================================

Diff for: hardware/arduino/avr/cores/arduino/USBCore.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -828,4 +828,8 @@ bool USBDevice_::wakeupHost()
828828
return false;
829829
}
830830

831+
void setupUSB() {
832+
USBDevice.attach();
833+
}
834+
831835
#endif /* if defined(USBCON) */

Diff for: hardware/arduino/avr/cores/arduino/main.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ int main(void)
3636

3737
initVariant();
3838

39-
#if defined(USBCON)
40-
USBDevice.attach();
41-
#endif
39+
setupUSB();
4240

4341
setup();
4442

0 commit comments

Comments
 (0)