mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 23:11:36 +08:00
[DO NOT MERGE] test param save from HPWORK
This commit is contained in:
@@ -204,6 +204,7 @@ void work_queues_init(void)
|
||||
work_hpthread,
|
||||
(char *const *)NULL);
|
||||
|
||||
#ifdef CONFIG_SCHED_LPWORK
|
||||
// Create low priority worker thread
|
||||
g_work[LPWORK].pid = px4_task_spawn_cmd("lpwork",
|
||||
SCHED_DEFAULT,
|
||||
@@ -211,6 +212,7 @@ void work_queues_init(void)
|
||||
2000,
|
||||
work_lpthread,
|
||||
(char *const *)NULL);
|
||||
#endif /* CONFIG_SCHED_LPWORK */
|
||||
|
||||
}
|
||||
|
||||
@@ -260,7 +262,7 @@ int work_hpthread(int argc, char *argv[])
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SCHED_LPWORK
|
||||
sched_garbagecollection();
|
||||
//sched_garbagecollection();
|
||||
#endif
|
||||
|
||||
/* Then process queued work. We need to keep interrupts disabled while
|
||||
|
||||
@@ -55,27 +55,6 @@ void WQueueTest::hp_worker_cb(void *p)
|
||||
wqep->do_hp_work();
|
||||
}
|
||||
|
||||
void WQueueTest::lp_worker_cb(void *p)
|
||||
{
|
||||
WQueueTest *wqep = (WQueueTest *)p;
|
||||
|
||||
wqep->do_lp_work();
|
||||
}
|
||||
|
||||
void WQueueTest::do_lp_work()
|
||||
{
|
||||
static int iter = 0;
|
||||
printf("done lp work\n");
|
||||
|
||||
if (iter > 5) {
|
||||
_lpwork_done = true;
|
||||
}
|
||||
|
||||
++iter;
|
||||
|
||||
work_queue(LPWORK, &_lpwork, (worker_t)&lp_worker_cb, this, 1000);
|
||||
}
|
||||
|
||||
void WQueueTest::do_hp_work()
|
||||
{
|
||||
static int iter = 0;
|
||||
@@ -98,11 +77,6 @@ int WQueueTest::main()
|
||||
//Put work on HP work queue
|
||||
work_queue(HPWORK, &_hpwork, (worker_t)&hp_worker_cb, this, 1000);
|
||||
|
||||
|
||||
//Put work on LP work queue
|
||||
work_queue(LPWORK, &_lpwork, (worker_t)&lp_worker_cb, this, 1000);
|
||||
|
||||
|
||||
// Wait for work to finsh
|
||||
while (!appState.exitRequested() && !(_hpwork_done && _lpwork_done)) {
|
||||
printf(" Sleeping for 2 sec...\n");
|
||||
|
||||
@@ -54,13 +54,10 @@ public:
|
||||
static px4::AppState appState; /* track requests to terminate app */
|
||||
private:
|
||||
static void hp_worker_cb(void *p);
|
||||
static void lp_worker_cb(void *p);
|
||||
|
||||
void do_lp_work(void);
|
||||
void do_hp_work(void);
|
||||
|
||||
bool _lpwork_done {false};
|
||||
bool _hpwork_done {false};
|
||||
work_s _lpwork {};
|
||||
|
||||
work_s _hpwork {};
|
||||
};
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
#define CONFIG_NFILE_STREAMS 1
|
||||
#define CONFIG_SCHED_WORKQUEUE 1
|
||||
#define CONFIG_SCHED_HPWORK 1
|
||||
#define CONFIG_SCHED_LPWORK 1
|
||||
|
||||
/** time in ms between checks for work in work queues **/
|
||||
#define CONFIG_SCHED_WORKPERIOD 50000
|
||||
|
||||
Reference in New Issue
Block a user