?? rti.c
字號:
/******************************************************************************
*
* (c) Freescale Inc. 2004 All rights reserved
*
* File Name : Rti.c
* Description :
*
* Version : 1.0
* Date : Jun/21/2004
*
*
******************************************************************************/
#include <timers.h>
#include "PE_types.h"
#include "IO_Map.h"
/******************************************************************************
*
*
******************************************************************************/
void RTI_Init (void)
{
CRGINT_RTIE = 0; /* Disable interrupt */
RTICTL_RTR = 0x73; /* Store given value to the prescaler */
}
/******************************************************************************
*
*
******************************************************************************/
void RTI_Enable (void)
{
CRGFLG_RTIF = 1; /* Reset interrupt request flag */
CRGINT_RTIE = 1; /* Enable interrupt */
}
/******************************************************************************
*
*
******************************************************************************/
void RTI_Disable (void)
{
CRGINT_RTIE = 0; /* Disable interrupt */
}
/******************************************************************************
*
*
******************************************************************************/
#pragma CODE_SEG NON_BANKED
interrupt void RealTimeInterrupt (void)
{
volatile static unsigned char state = 0;
CRGFLG_RTIF = 1; /* Reset interrupt request flag */
decrement_timers ();
if (state = ~state)
{
//PTL_PTL0 = 0; //Turn on ACTLED
}
else
{
//PTL_PTL0 = 1; //Turn off ACTLED
}
}
#pragma CODE_SEG DEFAULT
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -