大家来看看这样行吗? 想用PT0口输入捕捉(上升沿)产生中断。 S12dg128b的片子,codewarrior4.6编译器。编译时第7行出错啊,具体见程序。 程序: #include <hidef.h> /* common defines and macros */ #include <mc9s12dg128.h> /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dg128b" void init_pt(){ TIOS_IOS0=0; //PT0口输入捕捉 TCTL4=0X01; //上升沿捕捉 TMSK1=0X01;//开中断 可是编译时出现:C1815:TMSK1 not declared (or typename)---是怎么一回事啊? } #pragma CODE_SEG NON_BANKED
void interrupt 8 PORT_isr(void) { T**1=0X01; PORTB=0XFF; } #pragma CODE_SEG DEFAULT void main(void) { /* put your own code here */ init_pt(); EnableInterrupts; DDRT=0X07; DDRB =0xFF; PORTB =0x00; for(;;) {} /* wait forever */ /* please make sure that you never leave this function */ }
|