prevent variables being optimised
This commit is contained in:
@@ -191,7 +191,7 @@ USB_NOCACHE_RAM_SECTION struct dwc2_udc {
|
||||
|
||||
static inline int dwc2_reset(void)
|
||||
{
|
||||
uint32_t count = 0U;
|
||||
volatile uint32_t count = 0U;
|
||||
|
||||
/* Wait for AHB master IDLE state. */
|
||||
do {
|
||||
@@ -252,7 +252,7 @@ static inline void dwc2_set_mode(uint8_t mode)
|
||||
|
||||
static inline int dwc2_flush_rxfifo(void)
|
||||
{
|
||||
uint32_t count = 0;
|
||||
volatile uint32_t count = 0;
|
||||
|
||||
USB_OTG_GLB->GRSTCTL = USB_OTG_GRSTCTL_RXFFLSH;
|
||||
|
||||
@@ -267,7 +267,7 @@ static inline int dwc2_flush_rxfifo(void)
|
||||
|
||||
static inline int dwc2_flush_txfifo(uint32_t num)
|
||||
{
|
||||
uint32_t count = 0U;
|
||||
volatile uint32_t count = 0U;
|
||||
|
||||
USB_OTG_GLB->GRSTCTL = (USB_OTG_GRSTCTL_TXFFLSH | (num << 6));
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ struct dwc2_hcd {
|
||||
|
||||
static inline int dwc2_reset(void)
|
||||
{
|
||||
uint32_t count = 0U;
|
||||
volatile uint32_t count = 0U;
|
||||
|
||||
/* Wait for AHB master IDLE state. */
|
||||
do {
|
||||
@@ -127,7 +127,7 @@ static inline void dwc2_set_mode(uint8_t mode)
|
||||
|
||||
static inline int dwc2_flush_rxfifo(void)
|
||||
{
|
||||
uint32_t count = 0;
|
||||
volatile uint32_t count = 0;
|
||||
|
||||
USB_OTG_GLB->GRSTCTL = USB_OTG_GRSTCTL_RXFFLSH;
|
||||
|
||||
@@ -142,7 +142,7 @@ static inline int dwc2_flush_rxfifo(void)
|
||||
|
||||
static inline int dwc2_flush_txfifo(uint32_t num)
|
||||
{
|
||||
uint32_t count = 0U;
|
||||
volatile uint32_t count = 0U;
|
||||
|
||||
USB_OTG_GLB->GRSTCTL = (USB_OTG_GRSTCTL_TXFFLSH | (num << 6));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user