Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet.
Removed scheduler and memory allocation libraries. Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated). Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt.
This commit is contained in:
parent
2440ca268a
commit
d1e5266036
106 changed files with 3072 additions and 5760 deletions
|
@ -38,6 +38,8 @@ volatile uint8_t USB_CurrentMode = USB_MODE_NONE;
|
|||
volatile uint8_t USB_Options;
|
||||
#endif
|
||||
|
||||
volatile bool FrameElapsed;
|
||||
|
||||
void USB_Init(
|
||||
#if defined(USB_CAN_BE_BOTH)
|
||||
const uint8_t Mode
|
||||
|
@ -150,6 +152,8 @@ void USB_ResetInterface(void)
|
|||
USB_INT_DisableAllInterrupts();
|
||||
USB_INT_ClearAllInterrupts();
|
||||
|
||||
FrameElapsed = false;
|
||||
|
||||
USB_IsConnected = false;
|
||||
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
|
@ -224,6 +228,7 @@ void USB_ResetInterface(void)
|
|||
#if defined(USB_DEVICE_ONLY)
|
||||
USB_INT_Enable(USB_INT_SUSPEND);
|
||||
USB_INT_Enable(USB_INT_EORSTI);
|
||||
USB_INT_Enable(USB_INT_SOFI);
|
||||
|
||||
#if defined(CONTROL_ONLY_DEVICE)
|
||||
UENUM = ENDPOINT_CONTROLEP;
|
||||
|
@ -240,11 +245,13 @@ void USB_ResetInterface(void)
|
|||
|
||||
USB_INT_Enable(USB_INT_SRPI);
|
||||
USB_INT_Enable(USB_INT_BCERRI);
|
||||
USB_INT_Enable(USB_INT_HSOFI);
|
||||
#else
|
||||
if (USB_CurrentMode == USB_MODE_DEVICE)
|
||||
{
|
||||
USB_INT_Enable(USB_INT_SUSPEND);
|
||||
USB_INT_Enable(USB_INT_EORSTI);
|
||||
USB_INT_Enable(USB_INT_SOFI);
|
||||
|
||||
#if defined(CONTROL_ONLY_DEVICE)
|
||||
UENUM = ENDPOINT_CONTROLEP;
|
||||
|
@ -262,6 +269,7 @@ void USB_ResetInterface(void)
|
|||
|
||||
USB_INT_Enable(USB_INT_SRPI);
|
||||
USB_INT_Enable(USB_INT_BCERRI);
|
||||
USB_INT_Enable(USB_INT_HSOFI);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue