mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-29 14:04:16 +01:00
This commit is contained in:
parent
60eacca2c3
commit
ff4f22fe32
@ -190,28 +190,23 @@ static void * netcb (void *arg)
|
|||||||
{
|
{
|
||||||
if(prevInit)
|
if(prevInit)
|
||||||
{
|
{
|
||||||
bool reset=false;
|
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i < 500 && (netHalt != 2); i++) // 10 seconds to try to reset
|
net_deinit();
|
||||||
|
for(i=0; i < 400 && (netHalt != 2); i++) // 10 seconds to try to reset
|
||||||
{
|
{
|
||||||
res = net_get_status();
|
res = net_get_status();
|
||||||
if(res != -EBUSY) // trying to init net so we can't kill the net
|
if(res != -EBUSY) // trying to init net so we can't kill the net
|
||||||
{
|
{
|
||||||
usleep(2000);
|
usleep(2000);
|
||||||
net_wc24cleanup(); //kill the net
|
net_wc24cleanup(); //kill the net
|
||||||
reset=true;
|
prevInit=false; // net_wc24cleanup is called only once
|
||||||
|
usleep(20000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
usleep(20000);
|
usleep(20000);
|
||||||
}
|
}
|
||||||
if(!reset)
|
|
||||||
{
|
|
||||||
retry--;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
net_deinit();
|
|
||||||
usleep(2000);
|
usleep(2000);
|
||||||
res = net_init_async(NULL, NULL);
|
res = net_init_async(NULL, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user