Undefined: class_interface_map

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined: class_interface_map

Jump to solution
1,084 Views
amleng
Contributor IV

Hello all,

 

I try to build and run a "mass storage device" example in :

 

MQX 3.8\usb\host\examples\msd\msd_commands

 

I got error  " Undefined: class_interface_map" in host_common.c  in the following part: 

 

/*FUNCTION*----------------------------------------------------------------
*
* Function Name : usb_host_map_class_intf
* Returned Value : pointer to matching class map item, or NULL
* Comments :
* Map interface class etc. to a class driver table item.
* It is presumed that this function is called with USB interrupts disabled
*
*END*--------------------------------------------------------------------*/


static CLASS_MAP_PTR usb_host_map_class_intf
(
/* interface's device/descriptor/pipe bundle */
PIPE_BUNDLE_STRUCT_PTR pbs_ptr
)
{ /* Body */
CLASS_MAP_PTR map_ptr;
INTERFACE_DESCRIPTOR_PTR intf_desc;
uint_32 intf_class, map_class;

#ifdef _HOST_DEBUG_
DEBUG_LOG_TRACE("usb_host_map_class_intf");
#endif

intf_desc = (INTERFACE_DESCRIPTOR_PTR)pbs_ptr->intf_handle;

for (map_ptr = &class_interface_map[0]; ; map_ptr++) {
if (map_ptr->class_init == NULL) {
map_ptr = NULL;
break;
} /* EndIf */
intf_class = usb_hostdev_mask_class_etc(&intf_desc->bInterfaceClass,
&map_ptr->class_code_mask);

map_class = usb_hostdev_mask_class_etc(&map_ptr->class_code,
&map_ptr->class_code_mask);

if (intf_class != 0)
{
if (intf_class == map_class)
{
break;
}
}

} /* EndFor */

#ifdef _HOST_DEBUG_
DEBUG_LOG_TRACE("usb_host_map_class_intf SUCCESSFUL");
#endif

return map_ptr;

} /* EndBody */

 

 

 

 

 

I found this struc in usb_host_msd_bo.h but i am not sure how can I define this structure in  host_common.c   module.

 

typedef struct _Usb_Mass_Intf_Struct {

   GENERAL_CLASS                       G;                 // This is general class containing following

   _usb_pipe_handle                    CONTROL_PIPE;      /* control pipe handle*/

   _usb_pipe_handle                    BULK_IN_PIPE;      /* Bulk in pipe handle*/

   _usb_pipe_handle                    BULK_OUT_PIPE;     /* Bulk out pipe handle*/

   MASS_QUEUE_STRUCT                   QUEUE;             /* structure that queues requests*/

   uint_8                              INTERFACE_NUM;     /* interface number*/

   uint_8                              ALTERNATE_SETTING; /* Alternate setting*/

   CLASS_CALL_STRUCT_PTR               APP;               /* Store app handle, can help finding if lost */

} USB_MASS_CLASS_INTF_STRUCT, _PTR_ USB_MASS_CLASS_INTF_STRUCT_PTR;

 

 

 

 

I use twrK60 and CW 10.1

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
715 Views
amleng
Contributor IV

I added usb_classes.c to project and  #define USBCLASS_INC_MASS  1  in usb_classes.h then it works well.

View solution in original post

0 Kudos
Reply
3 Replies
715 Views
c0170
Senior Contributor III

Hi amleng,

 

examples work out of box, without any need to include or define anything. I builded this example in MQX 3.8 and none errors were shown.

 

Regards,

MartinK

0 Kudos
Reply
715 Views
amleng
Contributor IV

When I create this example application using CW 10.1 project wizard I got this error and some other link errors. Bit if I import the project to workspace the code runs without any error.

0 Kudos
Reply
716 Views
amleng
Contributor IV

I added usb_classes.c to project and  #define USBCLASS_INC_MASS  1  in usb_classes.h then it works well.

0 Kudos
Reply