main.c

来自「Freescal MC9S08GT60的一些实例源码」· C语言 代码 · 共 19 行

C
19
字号
#include <hidef.h> /* for EnableInterrupts macro */
#include <MC9S08GB60.h> /* include peripheral declarations */

void main(void) {
  DisableInterrupts;	//Disable Interrupts
  
  PTADD = 0x00; //Set Port A as input port
  PTBDD = 0xFF; //Set Port B as output port
  
  EnableInterrupts; //enable interrupts

  for(;;) {
    __RESET_WATCHDOG(); /* feeds the dog */
    
    PTBD = PTAD;  //Send Port A value to Port B
  } /* loop forever */

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?