tetris/game-ctrl/scheduler.h

38 lines
580 B
C
Raw Permalink Normal View History

2024-03-07 15:51:44 +01:00
/*
* PontCoopScheduler.h
*
* Created on: 29.08.2016
* Author: wn
*/
#ifndef PONTCOOPSCHEDULER_H_
#define PONTCOOPSCHEDULER_H_
#include <stdint.h>
2024-03-12 18:18:26 +01:00
#define MAX_NUM_OF_TASKS 2
2024-03-07 15:51:44 +01:00
typedef struct {
2024-03-13 14:52:46 +01:00
uint16_t delay;
uint16_t period;
2024-03-07 15:51:44 +01:00
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();
uint32_t getSeconds();
2024-03-07 15:51:44 +01:00
#endif /* PONTCOOPSCHEDULER_H_ */