scheduler added, tuned for 1ms

This commit is contained in:
2024-03-26 10:44:23 +01:00
parent d8e34ec209
commit 48c83f0b2d
5 changed files with 133 additions and 29 deletions

29
sound-driver/scheduler.h Normal file
View File

@ -0,0 +1,29 @@
#ifndef PONTCOOPSCHEDULER_H_
#define PONTCOOPSCHEDULER_H_
#include <stdint.h>
#define MAX_NUM_OF_TASKS 2
typedef struct {
uint16_t delay;
uint16_t period;
uint8_t run;
void (*exec)(void *handle);
void *handle;
} tTask;
void schInit();
void schAdd(void (*exec)(void *), void *handle, uint32_t delay, uint32_t period);
void schDel(void (*exec)(void *), void *handle);
void schExec();
void schUpdate();
uint8_t schTaskCnt();
#endif /* PONTCOOPSCHEDULER_H_ */