1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #pragma once
- #ifndef __RTOS_H
- #define __RTOS_H
- #include "stm8s.h"
- #define MAX_TASKS 9
- #define ENABLE_INTERRUPT enableInterrupts()
- #define DISABLE_INTERRUPT disableInterrupts()
- typedef struct task
- {
- void (*pFunc) (void);
- uint16_t delay;
- uint16_t period;
- uint8_t run;
- } task;
- void RTOS_Init (void);
- void RTOS_SetTask (void (*taskFunc)(void), uint16_t taskDelay, uint16_t taskPeriod);
- void RTOS_DeleteTask (void (*taskFunc)(void));
- void RTOS_DispatchTask (void);
- void Delay(__IO uint16_t nTime);
- #endif
|