mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 04:23:33 +08:00
POSIX: fixed hrt call and workqueue implementation
The HRT call processing normally happens via HW timer interrupt handler. Since the POSIX port has no ISR handling, the HP work queue is used. Instead of irq_save() and irq_restore() calls to disable/enable interrupts, a mutex is used to protect each queue. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -43,7 +43,10 @@
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
#include <queue.h>
|
||||
#include <stdio.h>
|
||||
#include <semaphore.h>
|
||||
#include <px4_workqueue.h>
|
||||
#include "work_lock.h"
|
||||
|
||||
#ifdef CONFIG_SCHED_WORKQUEUE
|
||||
|
||||
@@ -117,13 +120,13 @@ int work_queue(int qid, struct work_s *work, worker_t worker, void *arg, uint32_
|
||||
* from with task logic or interrupt handlers.
|
||||
*/
|
||||
|
||||
//flags = irqsave();
|
||||
work_lock(qid);
|
||||
work->qtime = clock_systimer(); /* Time work queued */
|
||||
|
||||
dq_addlast((dq_entry_t *)work, &wqueue->q);
|
||||
px4_task_kill(wqueue->pid, SIGCONT); /* Wake up the worker thread */
|
||||
|
||||
//irqrestore(flags);
|
||||
work_unlock(qid);
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user