cancel
Showing results for 
Search instead for 
Did you mean: 

Why does STM32F$ USBD_OTG_ISR_Handler bother to compute return value which is then ignored?

davidharrison69
Associate II
Posted on May 26, 2015 at 21:52

Something seems a little strange. In the STM32F4 USB OTG library, the

USBD_OTG_ISR_Handler(&USB_OTG_dev) function is only called from the OTG_FS_IRQHandler.

The USBD_OTG_ISR_Handler is defined to return a uint32_t value. Inside USBD_OTG_ISR_Handler, it goes to great lengths to compute a local retval return value under different conditions. The function then returns the computed value which is entirely ignored.

So there is no point whatsoever in going to such great lengths to compute that return value if it is ignored. So all of those return values from all the other ISR handlers can also be ignored.

0 REPLIES 0