/** ##########################################################################
**     Filename  : SimpleOs_Cfg.h
**     Project   :
**     Module    :
**     Processor :
**     Version   : 1.0
**     Compiler  :
**     Date/Time :
**     Abstract  :
**     Contents  :
**     Note      :
**     (c) Copyright dmdz Co.,Ltd
**  --------------------------------------------------------------------------
**               R E V I S I O N   H I S T O R Y
**  --------------------------------------------------------------------------
**  Date        Ver      Author             Description

**  -20231103-  V01-- --Linboyi---            --初版--
** #########################################################################*/
#ifndef SAMPLE_OS_CFG_H
#define SAMPLE_OS_CFG_H




/*****************************************************************************
* I N C L U D E   F I L E S
*****************************************************************************/
#include "SimpleOs_TimeCfg.h"
/*****************************************************************************
* D E F I N E S / M A C R O S
*****************************************************************************/

#define OS_DISABLE		(0u)
#define OS_ENABLE		(1u)


#define OS_Task1ms				(0u)
#define OS_Task1msDeltaTicks	OSTIME_TICKS(1000u)
#define OS_Task1msCycle		    OSTIME_TICKS(1000u)

#define OS_Task2ms				(1u)
#define OS_Task2msDeltaTicks	OSTIME_TICKS(2000u)
#define OS_Task2msCycle		    OSTIME_TICKS(2000u)


#define OS_Task5msA				(2u)
#define OS_Task5msADeltaTicks	OSTIME_TICKS(1000u)
#define OS_Task5msACycle		OSTIME_TICKS(5000u)

#define OS_Task5msB				(3u)
#define OS_Task5msBDeltaTicks	OSTIME_TICKS(3000u)
#define OS_Task5msBCycle		OSTIME_TICKS(5000u)


#define OS_Task5msC				(4u)
#define OS_Task5msCDeltaTicks	OSTIME_TICKS(5000u)
#define OS_Task5msCCycle		OSTIME_TICKS(5000u)

#define OS_Task10msA			(5u)
#define OS_Task10msADeltaTicks	OSTIME_TICKS(2000u)
#define OS_Task10msACycle		OSTIME_TICKS(10000u)

#define OS_Task10msB			(6u)
#define OS_Task10msBDeltaTicks	OSTIME_TICKS(4000u)
#define OS_Task10msBCycle		OSTIME_TICKS(10000u)

#define OS_Task10msC			(7u)
#define OS_Task10msCDeltaTicks	OSTIME_TICKS(6000u)
#define OS_Task10msCCycle		OSTIME_TICKS(10000u)


#define OS_Task10msD			(8u)
#define OS_Task10msDDeltaTicks	OSTIME_TICKS(8000u)
#define OS_Task10msDCycle		OSTIME_TICKS(10000u)


#define OS_Task10msE			(9u)
#define OS_Task10msEDeltaTicks	OSTIME_TICKS(10000u)
#define OS_Task10msECycle		OSTIME_TICKS(10000u)


#define OS_TASK_MAX_NUM	(10u)



#define OS_EventOne					(0u)
#define OS_EventOneDeltaTicks		(1u)
#define OS_EventOneCycle			OSTIME_TICKS(2000u)
#define OS_EventTwo					(1u)
#define OS_EventTwoDeltaTicks		(2u)
#define OS_EventTwoCycle			OSTIME_TICKS(500u)
#define OS_EVENT_TASK_MAX_NUM		(2u)

#define OS_STACK_ACCESS_BOTTOM		(uint32*)(0x2000EC00)
#define OS_STACK_ACCESS_TOP			(uint32*)(0x2000EC00+0x00000300)
#define OS_STACK_CHECK_PATTERN		(0xE5AAAAAAul)

#define TASK(x)	void x##Fun(void)


/*****************************************************************************
* T Y P E   D E F I N I T I O N S
*****************************************************************************/

#define OS_EnterCriticalArea_0()    System_DisableIrqGlobal()
#define OS_LeaveCriticalArea_0()    System_EnableIrqGlobal()
/*****************************************************************************
* G L O B A L   V A R I A B L E S
* only configuration table allowed here,variables are not allowed!
*****************************************************************************/

/*****************************************************************************
* C O N S T A N T S
*****************************************************************************/

/*****************************************************************************
* F U N C T I O N   P R O T O T Y P E
*****************************************************************************/

extern void OS_Task1msFun(void);
extern void OS_Task2msFun(void);
extern void OS_Task5msAFun(void);
extern void OS_Task5msBFun(void);
extern void OS_Task5msCFun(void);

extern void OS_Task10msAFun(void);
extern void OS_Task10msBFun(void);
extern void OS_Task10msCFun(void);
extern void OS_Task10msDFun(void);
extern void OS_Task10msEFun(void);
#endif