欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

main.c

Freescal MC9S08GT60的一些实例源码
C
字号:
#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 */
  IRQSC = 0x16; /* IRQ Interrupt Enable and event on falling edges sensitive */
  PTBD = PTAD;  /* Send Port A value to Port B */
  
  EnableInterrupts; /* enable interrupts */
  
  for(;;) {
    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
}


interrupt IRQ(void) {
  IRQSC_IRQACK = 1; /* IRQ interrupt acknowledge */
  
  PTBD = PTAD;  /* Send Port A value to Port B */
}

⌨️ 快捷键说明

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