小弟利用CodeWarrior对 Adtapt MC9S12E128 建立了一个简单的project:想实现利用输入开关来控制输出LEDs亮/灭的实验。我已经参照参考资料变了一点code如下.有一些问题。输入开关一直不工作。其高手指点。谢过了!
#include "Cpu.h" #include "OnGreen.h" #include "ONYellow.h" #include "OffGreen.h" #include "OffYellow0.h" #include "selectInput.h" #include "TestOK.h" #include "TInputs.h" #include "Bit1.h"
/* Include shared modules, which are used for whole project */ #include "PE_Types.h" #include "PE_Error.h" #include "PE_Const.h" #include "IO_Map.h"
byte Tinputs; byte Uinputs; bool select; bool input;
void main(void) { /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/
/*Write your code here*/ OnGreen_SetBit(0); /*Port name: A*/
OnGreen_ClrBit(0); /*Port name: A*/ ONYellow_SetBit(0); /*Port name: B*/
ONYellow_ClrBit(0); /*Port name: B*/ OffYellow0_SetVal(); /*Port name: Q*/ OffYellow0_ClrVal(); /*Port name: Q*/ Tinputs = TInputs_GetVal(); /*Port name: T*/ select = SelectInput_GetVal(); TestOK_SetVal(); TestOK_ClrVal(); /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/ for(;;); /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
|