⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ticktimersim.c

📁 这是CodeWarrior环境下基于freescale单片机上的实时操作系统代码.
💻 C
字号:
#include <hidef.h>		 	/* for EnableInterrupts macro */
#include <MC9S08GT60.h> 	/* include peripheral declarations */
#include "TickTimerSim.h"

#include "FreeRTOS.h"		/* The one and only FreeRTOS.h */


/*
*******************************************************************************
*
*
*
*******************************************************************************
*/
unsigned char TickTimer_Enable (void)
{	
	return 0;
}



/*
*******************************************************************************
*
*
*
*******************************************************************************
*/
signed char TickTimer_SetFreqHz (short Freq)
{

	return 0;
}


/*
*******************************************************************************
*
*
*
*******************************************************************************
*/
void TickTimer_Init(void)
{
	CTimer.TimerReg = 0x1FFF;
	CTimer.Control  = 0x01;
}



/*
*******************************************************************************
*
*
*
*******************************************************************************
*/
#pragma TRAP_PROC SAVE_NO_REGS
__interrupt 10 void TickTimer_Interrupt (void)
{	
	CTimer.Status |= 0x80;
		
	__asm ( "nop" );
		
	#if configUSE_PREEMPTION == 1
	{
		/* A context switch might happen so save the context. */
		portSAVE_CONTEXT();

		/* Increment the tick ... */
		vTaskIncrementTick();

		/* ... then see if the new tick value has necessitated a
		context switch. */
		vTaskSwitchContext();

		/* Restore the context of a task - which may be a different task
		to that interrupted. */
		portRESTORE_CONTEXT();	
	}
	#else
	{
		vTaskIncrementTick();
	}
	#endif
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -