This commit is contained in:
2024-06-02 18:34:16 +02:00
commit 275107cf3b
5 changed files with 201 additions and 0 deletions

28
scheduler.h Normal file
View File

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