mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
renamed Leonardo USB_ class to USBDevice_ to be unambiguous. renamed "USB" object to "USBDevice" to prevent conflict with USB Host library (thanks Massimo)
This commit is contained in:
parent
c7d98cc85d
commit
9520a531de
@ -9,17 +9,17 @@
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
// USB
|
// USB
|
||||||
|
|
||||||
class USB_
|
class USBDevice_
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
USB_();
|
USBDevice_();
|
||||||
bool configured();
|
bool configured();
|
||||||
|
|
||||||
void attach();
|
void attach();
|
||||||
void detach(); // Serial port goes down too...
|
void detach(); // Serial port goes down too...
|
||||||
void poll();
|
void poll();
|
||||||
};
|
};
|
||||||
extern USB_ USB;
|
extern USBDevice_ USBDevice;
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -627,13 +627,13 @@ u8 USBConnected()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
USB_ USB;
|
USBDevice_ USBDevice;
|
||||||
|
|
||||||
USB_::USB_()
|
USBDevice_::USBDevice_()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void USB_::attach()
|
void USBDevice_::attach()
|
||||||
{
|
{
|
||||||
_usbConfiguration = 0;
|
_usbConfiguration = 0;
|
||||||
UHWCON = 0x01; // power internal reg
|
UHWCON = 0x01; // power internal reg
|
||||||
@ -654,18 +654,18 @@ void USB_::attach()
|
|||||||
TX_RX_LED_INIT;
|
TX_RX_LED_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void USB_::detach()
|
void USBDevice_::detach()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for interrupts
|
// Check for interrupts
|
||||||
// TODO: VBUS detection
|
// TODO: VBUS detection
|
||||||
bool USB_::configured()
|
bool USBDevice_::configured()
|
||||||
{
|
{
|
||||||
return _usbConfiguration;
|
return _usbConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void USB_::poll()
|
void USBDevice_::poll()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
hardware/arduino/cores/arduino/main.cpp
Executable file → Normal file
2
hardware/arduino/cores/arduino/main.cpp
Executable file → Normal file
@ -5,7 +5,7 @@ int main(void)
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
#if defined(USBCON)
|
#if defined(USBCON)
|
||||||
USB.attach();
|
USBDevice.attach();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user