Skip to content

Commit 12a6084

Browse files
committed
usb: Fix build errors due to update to SDK 2.8
1. Re-add fields that were deleted as part of the update 2. Re-add code related to setting the Device Address Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 10c2089 commit 12a6084

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

mcux/middleware/usb/device/port/zephyr/usb_dc_mcux.h

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -323,22 +323,12 @@ typedef struct _usb_device_struct {
323323
/* Controller handle */
324324
usb_device_controller_handle controllerHandle;
325325
/* Controller interface handle */
326-
const usb_device_controller_interface_struct_t *controllerInterface;
327-
#if USB_DEVICE_CONFIG_USE_TASK
328-
/*!< Message queue buffer*/
329-
OSA_MSGQ_HANDLE_DEFINE(notificationQueueBuffer,
330-
USB_DEVICE_CONFIG_MAX_MESSAGES,
331-
USB_DEVICE_MESSAGES_SIZE);
332-
/*!< Message queue*/
333-
osa_msgq_handle_t notificationQueue;
334-
#endif
335-
/* Device callback function pointer */
336-
usb_device_callback_t deviceCallback;
337-
/* Endpoint callback function structure */
338-
usb_device_endpoint_callback_struct_t
339-
epCallback[USB_DEVICE_CONFIG_ENDPOINTS << 1U];
326+
const usb_device_controller_interface_struct_t *interface;
327+
usb_dc_status_callback status_callback;
328+
usb_ep_ctrl_data_t *eps;
329+
bool attached;
340330
/* Current device address */
341-
uint8_t deviceAddress;
331+
uint8_t address;
342332
/* Controller ID */
343333
uint8_t controllerId;
344334
/* Current device state */
@@ -349,10 +339,7 @@ typedef struct _usb_device_struct {
349339
#endif
350340
/* Is doing device reset or not */
351341
uint8_t isResetting;
352-
#if (defined(USB_DEVICE_CONFIG_USE_TASK) && (USB_DEVICE_CONFIG_USE_TASK > 0U))
353-
/* Whether call ep callback directly when the task is enabled */
354-
uint8_t epCallbackDirectly;
355-
#endif
342+
uint8_t setupDataStage;
356343
} usb_device_struct_t;
357344

358345
/* Endpoint status structure */

mcux/middleware/usb/device/usb_device_ehci.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ static usb_status_t USB_DeviceEhciTransfer(usb_device_ehci_state_struct_t *ehciS
5858
uint8_t *buffer,
5959
uint32_t length);
6060

61+
extern usb_status_t USB_DeviceNotificationTrigger(void *handle, void *msg);
62+
6163
/*******************************************************************************
6264
* Variables
6365
******************************************************************************/
@@ -913,7 +915,6 @@ static usb_status_t USB_DeviceEhciTransfer(usb_device_ehci_state_struct_t *ehciS
913915
uint8_t qhIdle = 0U;
914916
uint8_t waitingSafelyAccess = 1U;
915917
uint32_t primeTimesCount = 0U;
916-
void *temp;
917918
USB_OSA_SR_ALLOC();
918919

919920
if (NULL == ehciState)
@@ -1662,18 +1663,14 @@ usb_status_t USB_DeviceEhciControl(usb_device_controller_handle ehciHandle, usb_
16621663
}
16631664
}
16641665
break;
1665-
case kUSB_DeviceControlPreSetDeviceAddress:
1666-
if (NULL != param)
1666+
case kUSB_DeviceControlSetDeviceAddress:
1667+
if (param)
16671668
{
16681669
temp8 = (uint8_t *)param;
1669-
ehciState->registerBase->DEVICEADDR =
1670-
((((uint32_t)(*temp8)) << USBHS_DEVICEADDR_USBADR_SHIFT) | USBHS_DEVICEADDR_USBADRA_MASK);
1670+
ehciState->registerBase->DEVICEADDR = (((uint32_t)(*temp8)) << USBHS_DEVICEADDR_USBADR_SHIFT);
16711671
error = kStatus_USB_Success;
16721672
}
16731673
break;
1674-
case kUSB_DeviceControlSetDeviceAddress:
1675-
error = kStatus_USB_Success;
1676-
break;
16771674
case kUSB_DeviceControlGetSynchFrame:
16781675
break;
16791676
#if (defined(USB_DEVICE_CONFIG_LOW_POWER_MODE) && (USB_DEVICE_CONFIG_LOW_POWER_MODE > 0U))

0 commit comments

Comments
 (0)