summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorMasterPhi <[email protected]>2023-01-11 18:49:15 +0100
committerMasterPhi <[email protected]>2023-01-11 18:50:38 +0100
commit9d19ed940e303ea01a685ebba986b24713f5febd (patch)
tree7a101223f9b248856d34dac7d28c81fc92e8f059 /src/portable
parent8775d55adc7c9b0812b7d593b24518c046dd3d82 (diff)
dwc2: fix IAR warnings.
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/synopsys/dwc2/dcd_dwc2.c9
-rw-r--r--src/portable/synopsys/dwc2/dwc2_stm32.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c
index b53735a5e..c6132a1f5 100644
--- a/src/portable/synopsys/dwc2/dcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/dcd_dwc2.c
@@ -529,8 +529,10 @@ void dcd_init (uint8_t rhport)
dwc2->dcfg |= DCFG_NZLSOHSK;
// Clear all interrupts
- dwc2->gintsts |= dwc2->gintsts;
- dwc2->gotgint |= dwc2->gotgint;
+ uint32_t int_mask = dwc2->gintsts;
+ dwc2->gintsts |= int_mask;
+ int_mask = dwc2->gotgint;
+ dwc2->gotgint |= int_mask;
// Required as part of core initialization.
// TODO: How should mode mismatch be handled? It will cause
@@ -1219,7 +1221,8 @@ void dcd_int_handler(uint8_t rhport)
{
dwc2_regs_t *dwc2 = DWC2_REG(rhport);
- uint32_t const int_status = dwc2->gintsts & dwc2->gintmsk;
+ uint32_t const int_mask = dwc2->gintmsk;
+ uint32_t const int_status = dwc2->gintsts & int_mask;
if(int_status & GINTSTS_USBRST)
{
diff --git a/src/portable/synopsys/dwc2/dwc2_stm32.h b/src/portable/synopsys/dwc2/dwc2_stm32.h
index b63d1fcd0..cb455bd90 100644
--- a/src/portable/synopsys/dwc2/dwc2_stm32.h
+++ b/src/portable/synopsys/dwc2/dwc2_stm32.h
@@ -122,13 +122,13 @@ static const dwc2_controller_t _dwc2_controller[] =
TU_ATTR_ALWAYS_INLINE
static inline void dwc2_dcd_int_enable(uint8_t rhport)
{
- NVIC_EnableIRQ(_dwc2_controller[rhport].irqnum);
+ NVIC_EnableIRQ((IRQn_Type)_dwc2_controller[rhport].irqnum);
}
TU_ATTR_ALWAYS_INLINE
static inline void dwc2_dcd_int_disable (uint8_t rhport)
{
- NVIC_DisableIRQ(_dwc2_controller[rhport].irqnum);
+ NVIC_DisableIRQ((IRQn_Type)_dwc2_controller[rhport].irqnum);
}
TU_ATTR_ALWAYS_INLINE