Skip to content

Commit 9520a53

Browse files
committed
renamed Leonardo USB_ class to USBDevice_ to be unambiguous. renamed "USB" object to "USBDevice" to prevent conflict with USB Host library (thanks Massimo)
1 parent c7d98cc commit 9520a53

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
//================================================================================
1010
// USB
1111

12-
class USB_
12+
class USBDevice_
1313
{
1414
public:
15-
USB_();
15+
USBDevice_();
1616
bool configured();
1717

1818
void attach();
1919
void detach(); // Serial port goes down too...
2020
void poll();
2121
};
22-
extern USB_ USB;
22+
extern USBDevice_ USBDevice;
2323

2424
//================================================================================
2525
//================================================================================

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,13 @@ u8 USBConnected()
627627
//=======================================================================
628628
//=======================================================================
629629

630-
USB_ USB;
630+
USBDevice_ USBDevice;
631631

632-
USB_::USB_()
632+
USBDevice_::USBDevice_()
633633
{
634634
}
635635

636-
void USB_::attach()
636+
void USBDevice_::attach()
637637
{
638638
_usbConfiguration = 0;
639639
UHWCON = 0x01; // power internal reg
@@ -654,18 +654,18 @@ void USB_::attach()
654654
TX_RX_LED_INIT;
655655
}
656656

657-
void USB_::detach()
657+
void USBDevice_::detach()
658658
{
659659
}
660660

661661
// Check for interrupts
662662
// TODO: VBUS detection
663-
bool USB_::configured()
663+
bool USBDevice_::configured()
664664
{
665665
return _usbConfiguration;
666666
}
667667

668-
void USB_::poll()
668+
void USBDevice_::poll()
669669
{
670670
}
671671

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

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ int main(void)
55
init();
66

77
#if defined(USBCON)
8-
USB.attach();
8+
USBDevice.attach();
99
#endif
1010

1111
setup();

0 commit comments

Comments
 (0)