[En-Nut-Discussion] NutNetIfConfig() blocks other threads
Coleman Brumley
cbrumley at gopolar.com
Tue May 26 15:03:26 CEST 2009
Yes, I've run into this problem.
The solution I came up with is to exit the loop after a timeout, though.
- Coleman
> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of urbi
> Sent: Tuesday, May 26, 2009 3:00 AM
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion] NutNetIfConfig() blocks other threads
>
>
> Hello,
>
> I have a Problem with initializing the ethernet without a physical
> connection. In this case the function NutNetIfConfig() is blocking all
> other
> threads. I have tryed to give different priority to the other threads,
> but
> the function NutNetIfConfig() is still blocking.
>
> The reason I found in the function EmacReset(uint32_t tmo) in the
> module
> at91_emac.c. I am using a AT91SAM7x256 microcontroller. If no physical
> connection is detected the function is waiting in a while loop. To give
> the
> other threads CPU-time I add a NutSleep(0) statement in this while
> loop:
>
> while (--tmo) {
> if (phy_inw(NIC_PHY_BMSR) & NIC_PHY_BMSR_ANCOMPL) {
> break;
> }
> NutSleep(0);
> }
>
> In this way all other threads are not blocked when no physical
> connation is
> detected.
> Has anyone else the same problem?
>
> Regardes, Urban
>
> --
> View this message in context:
> http://www.nabble.com/NutNetIfConfig%28%29-blocks-other-threads-
> tp23717701p23717701.html
> Sent from the MicroControllers - Ethernut mailing list archive at
> Nabble.com.
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list