mirror of
https://github.com/apache/nuttx.git
synced 2026-08-11 15:35:10 +00:00
usrsock: used wd timer to process loop event
used wdt thread process event Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
This commit is contained in:
parent
c594616e99
commit
bbcf8fe30b
2 changed files with 10 additions and 4 deletions
|
|
@ -224,10 +224,6 @@ static int sim_loop_task(int argc, char **argv)
|
|||
|
||||
sched_lock();
|
||||
|
||||
#ifdef CONFIG_SIM_NETUSRSOCK
|
||||
host_usrsock_loop();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SIM_SOUND
|
||||
sim_audio_loop();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#define SIM_USRSOCK_BUFSIZE (400 * 1024)
|
||||
#define SIM_USRSOCK_PERIOD MSEC2TICK(CONFIG_SIM_LOOP_INTERVAL)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
|
|
@ -49,6 +50,7 @@ struct usrsock_s
|
|||
{
|
||||
uint8_t in[SIM_USRSOCK_BUFSIZE];
|
||||
uint8_t out[SIM_USRSOCK_BUFSIZE];
|
||||
struct work_s work;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -391,6 +393,12 @@ static const usrsock_handler_t g_usrsock_handler[] =
|
|||
[USRSOCK_REQUEST_SHUTDOWN] = usrsock_shutdown_handler,
|
||||
};
|
||||
|
||||
static void sim_usrsock_work(void *arg)
|
||||
{
|
||||
work_queue(HPWORK, &g_usrsock.work, (void *)sim_usrsock_work,
|
||||
NULL, SIM_USRSOCK_PERIOD);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -402,6 +410,8 @@ int usrsock_event_callback(int16_t usockid, uint16_t events)
|
|||
|
||||
void usrsock_register(void)
|
||||
{
|
||||
work_queue(HPWORK, &g_usrsock.work, (void *)sim_usrsock_work,
|
||||
NULL, SIM_USRSOCK_PERIOD);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue