Chris Solomon

Bug Report: Minor errors in USB Host code

Discussion created by Chris Solomon on Jul 30, 2014
Latest reply on Jul 30, 2014 by Daniel Chen

Hi,

I'm reviewing the changes in MQX 4.1.0 and spotted a couple of minor errors in the USB host code - (actually I am using v4.8.4 of the GCC compiler and these come out as warnings):

 

usb_host_msd_bo.c Line 109 -

   USB_mem_zero(intf_ptr, sizeof(USB_MASS_CLASS_INTF_STRUCT_PTR));

 

Looks like this is a typo - the intp_ptr is a pointer to a USB_MASS_CLASS_INTF_STRUCT, so it looks like the intention was that the whole structure be zeroed, where as in reality only the first 4 bytes are being zeroed.

 

Same thing in usb_host_printer.c at Line 468

   USB_mem_zero (prt_intf,sizeof(PRINTER_INTERFACE_STRUCT_PTR));

 

I don't think these are going to cause any problems, but I figured if you are still using version 4.7 of the compiler you might not have see these, and they look like quick and easy fixes.

 

Thanks

 

Chris

Outcomes