Skip to content

Commit 28eaac3

Browse files
authored
Merge pull request #4449 from c1728p9/lpc1768_fix
Fix semaphore usage on lpc1768 emac
2 parents 744b95c + e578690 commit 28eaac3

File tree

1 file changed

+4
-1
lines changed
  • features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP

1 file changed

+4
-1
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/lpc17_emac.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,13 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p)
604604

605605
/* Wait until enough descriptors are available for the transfer. */
606606
/* THIS WILL BLOCK UNTIL THERE ARE ENOUGH DESCRIPTORS AVAILABLE */
607-
while (dn > lpc_tx_ready(netif))
608607
#if NO_SYS == 0
608+
for (idx = 0; idx < dn; idx++) {
609609
osSemaphoreAcquire(lpc_enetif->xTXDCountSem.id, osWaitForever);
610+
}
611+
MBED_ASSERT(dn <= lpc_tx_ready(netif));
610612
#else
613+
while (dn > lpc_tx_ready(netif))
611614
osDelay(1);
612615
#endif
613616

0 commit comments

Comments
 (0)