File tree 3 files changed +12
-3
lines changed
hardware/arduino/avr/cores/arduino
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class USBDevice_
67
67
bool wakeupHost (); // returns false, when wakeup cannot be processed
68
68
};
69
69
extern USBDevice_ USBDevice;
70
+ void setupUSB ();
70
71
71
72
// ================================================================================
72
73
// ================================================================================
Original file line number Diff line number Diff line change @@ -828,4 +828,8 @@ bool USBDevice_::wakeupHost()
828
828
return false ;
829
829
}
830
830
831
+ void setupUSB () {
832
+ USBDevice.attach ();
833
+ }
834
+
831
835
#endif /* if defined(USBCON) */
Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ void initVariant() __attribute__((weak));
28
28
void initVariant () { }
29
29
30
30
void setupUSB () __attribute__((weak));
31
- void setupUSB () { }
31
+ void setupUSB () {
32
+ #if defined(USBCON) && (MAGIC_KEY_POS != (RAMEND-1))
33
+ USBDevice.attach ();
34
+ #endif
35
+ }
32
36
33
37
int main (void )
34
38
{
@@ -37,9 +41,9 @@ int main(void)
37
41
initVariant ();
38
42
39
43
#if defined(USBCON)
40
- USBDevice. attach ();
44
+ setupUSB ();
41
45
#endif
42
-
46
+
43
47
setup ();
44
48
45
49
for (;;) {
You can’t perform that action at this time.
0 commit comments