Skip to content

Commit c65465f

Browse files
cyliangtw0xc0170
authored andcommitted
Fix NUC472 Ethernet wrong INT status in RX_Action
1 parent 68334bc commit c65465f

File tree

1 file changed

+6
-6
lines changed
  • features/net/FEATURE_IPV4/lwip-interface/lwip-eth/arch/TARGET_NUVOTON/TARGET_NUC472

1 file changed

+6
-6
lines changed

features/net/FEATURE_IPV4/lwip-interface/lwip-eth/arch/TARGET_NUVOTON/TARGET_NUC472/nuc472_eth.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,15 @@ void ETH_halt(void)
252252
EMAC->CTL &= ~(EMAC_CTL_RXON_Msk | EMAC_CTL_TXON_Msk);
253253
}
254254

255-
255+
unsigned int m_status;
256256

257257
void EMAC_RX_IRQHandler(void)
258258
{
259259
unsigned int cur_entry, status;
260260

261-
status = EMAC->INTSTS & 0xFFFF;
262-
EMAC->INTSTS = status;
263-
if (status & EMAC_INTSTS_RXBEIF_Msk) {
261+
m_status = EMAC->INTSTS & 0xFFFF;
262+
EMAC->INTSTS = m_status;
263+
if (m_status & EMAC_INTSTS_RXBEIF_Msk) {
264264
// Shouldn't goes here, unless descriptor corrupted
265265
printf("RX descriptor corrupted \r\n");
266266
//return;
@@ -275,7 +275,7 @@ void EMAC_RX_Action(void)
275275

276276
cur_entry = EMAC->CRXDSA;
277277

278-
if ((cur_entry == (u32_t)cur_rx_desc_ptr) && (!(status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occures
278+
if ((cur_entry == (u32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occures
279279
break;
280280
status = cur_rx_desc_ptr->status1;
281281

@@ -344,4 +344,4 @@ int ETH_link_ok()
344344
if(mdio_read(CONFIG_PHY_ADDR, MII_BMSR) & BMSR_LSTATUS)
345345
return 1;
346346
return 0;
347-
}
347+
}

0 commit comments

Comments
 (0)