removed low prio queue

This commit is contained in:
2017-12-23 20:55:45 +01:00
parent 97b6fd0028
commit 4f92b97305
5 changed files with 28 additions and 82 deletions
+1 -2
View File
@@ -5,7 +5,7 @@
#ifndef GEX_SCHED_QUEUE_H
#define GEX_SCHED_QUEUE_H
#include <TinyFrame/TinyFrame.h>
#include <TinyFrame.h>
typedef struct sched_que_item Job;
typedef void (*ScheduledJobCb) (Job *job);
@@ -35,7 +35,6 @@ struct rx_que_item {
uint8_t data[64];
};
#define LP_SCHED_CAPACITY 5
#define HP_SCHED_CAPACITY 5
#define RX_QUE_CAPACITY 16
+8 -35
View File
@@ -5,23 +5,18 @@
#include "platform.h"
#include "task_sched.h"
extern osMessageQId queSchedLPHandle;
extern osMessageQId queSchedHPHandle;
extern osMessageQId queSchedHandle;
volatile uint32_t jobQueHighWaterMarkHP = 0;
volatile uint32_t jobQueHighWaterMarkLP = 0;
volatile uint32_t jobQueHighWaterMark = 0;
/**
* Schedule a function for later execution in the jobs thread
*
* @param callback - the callback function
* @param prio - priority, selects which job queue to use
* @param data1 - first data object, NULL if not needed; usually context/handle
* @param data2 - second data object, NULL if not needed; usually data/argument
*/
void scheduleJob(Job *job, enum task_sched_prio prio)
void scheduleJob(Job *job)
{
QueueHandle_t que = (prio == TSK_SCHED_LOW ? queSchedLPHandle : queSchedHPHandle);
QueueHandle_t que = queSchedHandle;
assert_param(que != NULL);
assert_param(job->cb != NULL);
@@ -44,44 +39,22 @@ void scheduleJob(Job *job, enum task_sched_prio prio)
}
#if USE_STACK_MONITOR
if (prio == TSK_SCHED_LOW) {
jobQueHighWaterMarkLP = MAX(jobQueHighWaterMarkLP, count);
} else {
jobQueHighWaterMarkHP = MAX(jobQueHighWaterMarkHP, count);
}
jobQueHighWaterMark = MAX(jobQueHighWaterMark, count);
#endif
}
/**
* Low priority task queue handler
* job queue handler (for use in interrupts to do longer stuff on a thread)
*
* @param argument
*/
void TaskSchedLP (const void * argument)
{
dbg("> Low priority queue task started!");
struct sched_que_item job;
while (1) {
xQueueReceive(queSchedLPHandle, &job, osWaitForever);
assert_param(job.cb != NULL);
job.cb(&job);
}
}
/**
* High priority task queue handler
*
* @param argument
*/
void TaskSchedHP (const void * argument)
void TaskJobQueue(const void *argument)
{
dbg("> High priority queue task started!");
struct sched_que_item job;
while (1) {
xQueueReceive(queSchedHPHandle, &job, osWaitForever);
xQueueReceive(queSchedHandle, &job, osWaitForever);
assert_param(job.cb != NULL);
job.cb(&job);
+4 -13
View File
@@ -8,22 +8,13 @@
#include "platform.h"
#include "sched_queue.h"
enum task_sched_prio {
TSK_SCHED_LOW = 0,
TSK_SCHED_HIGH = 1,
};
#if USE_STACK_MONITOR
extern volatile uint32_t jobQueHighWaterMarkHP;
extern volatile uint32_t jobQueHighWaterMarkLP;
extern volatile uint32_t jobQueHighWaterMark;
#endif
extern osThreadId tskSchedLPHandle;
void TaskSchedLP (const void * argument);
extern osThreadId tskJobRunnerHandle;
void TaskJobQueue(const void *argument);
extern osThreadId tskSchedHPHandle;
void TaskSchedHP (const void * argument);
void scheduleJob(Job *job, enum task_sched_prio prio);
void scheduleJob(Job *job);
#endif //GEX_TASK_SCHED_H