📄 ticktimersim.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 + -