main.c

来自「本程序适用于DG128最小系统测试」· C语言 代码 · 共 32 行

C
32
字号
#include <hidef.h>      /* common defines and macros */
#include <mc9s12dg128.h>     /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dg128b"


unsigned int  i =0;

void delay( unsigned int count) 
 {
   for (i = 1; i < count; i ++);
 }
 
 void light (void) 
 {
   DDRB = 0xff;				//PTB口设定为输出
   for(;;) {
   PORTB = 0x01;
   delay(60000);
   PORTB = 0x00;
   delay(60000);
   }
 } 


void main(void) {
  /* put your own code here */
  EnableInterrupts;

 light();
  
}

⌨️ 快捷键说明

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