我设计的程序用C语言编写的,只有一个Timer8和LED,程序如下
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#pragma interrupt_handle timer;
void main()
{
while(1)
{
Timer8_1_EnableInt();
M8C_EnableGInt;
Timer8_1_Start();
LED_1_Start();
LED_1_Switch(1);
}
}
void timer()
{
Timer8_1_Stop();
LED_1_Invert();
Timer8_1_WritePeriod(999);
Timer8_1_Start();
}
Timer8_1INT.asm里改的部分:
_Timer8_1_ISR:
;@PSoC_UserCode_BODY@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
jmp _timer
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
reti
但是好像不执行,有朋友给点提议吗?? |