Remove USB_MODE_* macros, replace with a semantically linked USB_Modes_t enum.
Moved the USB device selection logic for ENDPOINT_TOTAL_ENDPOINTS further up in Endpoint.h to where the endpoint bank capabilities are determined, to reduce the total number of device-specific logic. Change USB_Host_WaitMS() to test and disable the HSOFI interrupt before resuming the bus, so that it does not fire before the delay loop has run. Add missing const qualifier to the parameter of USB_Host_ClearPipeStall().
This commit is contained in:
parent
c1cfffd8eb
commit
7aaced1e8b
11 changed files with 77 additions and 78 deletions
|
@ -33,7 +33,7 @@
|
|||
#include "USBController.h"
|
||||
|
||||
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))
|
||||
volatile uint8_t USB_CurrentMode = USB_MODE_NONE;
|
||||
volatile uint8_t USB_CurrentMode = USB_MODE_None;
|
||||
#endif
|
||||
|
||||
#if !defined(USE_STATIC_OPTIONS)
|
||||
|
@ -101,7 +101,7 @@ void USB_ShutDown(void)
|
|||
#endif
|
||||
|
||||
#if defined(USB_CAN_BE_BOTH)
|
||||
USB_CurrentMode = USB_MODE_NONE;
|
||||
USB_CurrentMode = USB_MODE_None;
|
||||
#endif
|
||||
|
||||
USB_IsInitialized = false;
|
||||
|
@ -138,7 +138,7 @@ void USB_ResetInterface(void)
|
|||
|
||||
USB_CLK_Unfreeze();
|
||||
|
||||
if (USB_CurrentMode == USB_MODE_DEVICE)
|
||||
if (USB_CurrentMode == USB_MODE_Device)
|
||||
{
|
||||
#if defined(USB_CAN_BE_DEVICE)
|
||||
#if (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))
|
||||
|
@ -148,7 +148,7 @@ void USB_ResetInterface(void)
|
|||
USB_Init_Device();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
else if (USB_CurrentMode == USB_MODE_Host)
|
||||
{
|
||||
#if defined(USB_CAN_BE_HOST)
|
||||
UHWCON &= ~(1 << UIMOD);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue