多谢CHEN斑主的解答,但似乎不是这样. 我搞了个最简单的程序也不行,理论上没问题啊 #include <hidef.h> /* common defines and macros */ #include <mc9s12dg128.h> /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12dg128b" struct { byte Right_1 ; byte Right_2 ; byte Right_3 ; byte Right_4 ; byte Left_1 ; byte Left_2 ; byte Left_3 ; byte Left_4 ; } LightElectr;
#define LightElectr.Right_1 PORTA_BIT3 #define LightElectr.Right_2 PORTA_BIT2 #define LightElectr.Right_3 PORTA_BIT1 #define LightElectr.Right_4 PORTA_BIT0 #define LightElectr.Left_1 PORTA_BIT4 #define LightElectr.Left_2 PORTA_BIT5 #define LightElectr.Left_3 PORTA_BIT6 #define LightElectr.Left_4 PORTA_BIT7 void main(void) { /* put your own code here */ EnableInterrupts; for(;;) {} /* wait forever */ /* please make sure that you never leave this function */ }
|