mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 05:23:34 +08:00
Merge branch 'cmake-2' into cmake-2-pthread
This commit is contained in:
@@ -303,6 +303,11 @@ int VCDevExample::main()
|
||||
ret = 1;
|
||||
goto fail2;
|
||||
}
|
||||
PX4_INFO("TEST: 100ms TIMEOUT POLL -----------");
|
||||
if(do_poll(fd, 0, 30, 100)) {
|
||||
ret = 1;
|
||||
goto fail2;
|
||||
}
|
||||
PX4_INFO("TEST: 1 SEC TIMOUT POLL ------------");
|
||||
if(do_poll(fd, 1000, 3, 0)) {
|
||||
ret = 1;
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <px4_config.h>
|
||||
#include <px4_defines.h>
|
||||
#include <stdint.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <queue.h>
|
||||
@@ -73,6 +74,26 @@ px4_sem_t _hrt_work_lock;
|
||||
****************************************************************************/
|
||||
static void hrt_work_process(void);
|
||||
|
||||
static void _sighandler(int sig_num);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: _sighandler
|
||||
*
|
||||
* Description:
|
||||
* This is the handler for the signal to wake the queue processing thread
|
||||
*
|
||||
* Input parameters:
|
||||
* sig_num - the received signal
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
static void _sighandler(int sig_num)
|
||||
{
|
||||
PX4_DEBUG("RECEIVED SIGNAL %d", sig_num);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: work_process
|
||||
*
|
||||
@@ -251,5 +272,11 @@ void hrt_work_queue_init(void)
|
||||
work_hrtthread,
|
||||
(char *const *)NULL);
|
||||
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
signal(SIGALRM, _sighandler);
|
||||
#else
|
||||
signal(SIGCONT, _sighandler);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user