mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-25 20:16:53 +01:00
fix device thread sleep - keep one eye open!
This commit is contained in:
parent
8a3d3fa8c5
commit
3988b2661f
@ -85,10 +85,19 @@ HaltDeviceThread()
|
|||||||
* This checks our devices for changes (SD/USB removed) and
|
* This checks our devices for changes (SD/USB removed) and
|
||||||
* initializes the network in the background
|
* initializes the network in the background
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
static int devsleep = 3*1000*1000;
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
devicecallback (void *arg)
|
devicecallback (void *arg)
|
||||||
{
|
{
|
||||||
sleep(1);
|
while(devsleep > 0)
|
||||||
|
{
|
||||||
|
if(deviceHalt)
|
||||||
|
LWP_SuspendThread(devicethread);
|
||||||
|
usleep(100);
|
||||||
|
devsleep -= 100;
|
||||||
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
@ -130,10 +139,15 @@ devicecallback (void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(deviceHalt)
|
devsleep = 1000*1000; // 1 sec
|
||||||
LWP_SuspendThread(devicethread);
|
|
||||||
else
|
while(devsleep > 0)
|
||||||
sleep(1); // suspend thread for 1 sec
|
{
|
||||||
|
if(deviceHalt)
|
||||||
|
LWP_SuspendThread(devicethread);
|
||||||
|
usleep(100);
|
||||||
|
devsleep -= 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user