File tree 3 files changed +11
-4
lines changed
hardware/arduino/avr/cores/arduino
3 files changed +11
-4
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,17 +28,19 @@ void initVariant() __attribute__((weak));
28
28
void initVariant () { }
29
29
30
30
void setupUSB () __attribute__((weak));
31
- void setupUSB () { }
31
+ void setupUSB () {
32
+ #if MAGIC_KEY_POS != (RAMEND-1)
33
+ USBDevice.attach ();
34
+ #endif
35
+ }
32
36
33
37
int main (void )
34
38
{
35
39
init ();
36
40
37
41
initVariant ();
38
42
39
- #if defined(USBCON)
40
- USBDevice.attach ();
41
- #endif
43
+ setupUSB ();
42
44
43
45
setup ();
44
46
You can’t perform that action at this time.
0 commit comments