mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5745 from kjbracey-arm/k64f_init_order
K64F Ethernet: avoid using NULL thread during initpull/5621/head
commit
9cce4d2b06
|
@ -140,7 +140,9 @@ static void k64f_tx_reclaim(struct k64f_enetdata *k64f_enet)
|
|||
*/
|
||||
void enet_mac_rx_isr()
|
||||
{
|
||||
osThreadFlagsSet(k64f_enetdata.thread, FLAG_RX);
|
||||
if (k64f_enetdata.thread) {
|
||||
osThreadFlagsSet(k64f_enetdata.thread, FLAG_RX);
|
||||
}
|
||||
}
|
||||
|
||||
void enet_mac_tx_isr()
|
||||
|
@ -756,6 +758,9 @@ err_t eth_arch_enetif_init(struct netif *netif)
|
|||
/* Worker thread */
|
||||
k64f_enetdata.thread = sys_thread_new("k64f_emac_thread", emac_thread, netif->state, THREAD_STACKSIZE, THREAD_PRIORITY)->id;
|
||||
|
||||
/* Trigger thread to deal with any RX packets that arrived before thread was started */
|
||||
enet_mac_rx_isr();
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue