功能:
**定时1ms的中断(使用GTM模块的子单元TOM0模块),借助LED检测,分别300ms 500ms间隔闪烁2个LED **
基于iLLD库,跟外设GTM模块的子模块TOM相关的基本都在:
#include "IfxGtm_Tom_Timer.h"
#include "IfxGtm.h"
#include "IfxGtm_Cmu.h"
interrupt.c文件:
#include "Interrupt.h"
#include "IfxGtm_Tom_Timer.h"
#include "IfxPort.h"
#include "Blinky_LED.h"
#define ISR_PRIORITY_TOM 9 /* Interrupt priority number */
#define TOM_FREQ 1000.0f /* TOM frequency */
short one_sec_flag = 0;
IfxGtm_Tom_Timer g_timerDriver; //类似linux文件句柄
/* Macro to define the Interrupt Service Routine. */
IFX_INTERRUPT(interruptGtmTom, 0, ISR_PRIORITY_TOM);
/* Interrupt Service Routine of the TOM */
void interruptGtmTom(void)
{
static int i,j,one_sec = 0;
IfxGtm_Tom_Timer_acknowledgeTimerIrq(&g_timerDriver); /* Clear the timer event */
i++