Skip to content

K64F Ethernet: avoid using NULL thread during init #5745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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;
}

Expand Down