⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 Freescale Code Warrior中C的编程
💻 C
字号:
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

#define FLOATING_P

void MCU_init(void); /* Device initialization function declaration */

#ifdef FLOATING_P
void main(void) {

  volatile float OverheadTest;
  volatile int a = 5;
  

  EnableInterrupts; /* enable interrupts */

  /* include your code here */

  for(;;) {
    
    OverheadTest = 1;
    OverheadTest /= 10;
    OverheadTest = (float)a;
    OverheadTest *= OverheadTest;
    OverheadTest++;

    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave this function */
}

#else

void main(void) {
  volatile int NoFloatTest;
  volatile char a;
  
  EnableInterrupts; /* enable interrupts */

  a = 5;
  
  for(;;) {
  NoFloatTest = 1;
  NoFloatTest /= 10;
  NoFloatTest = (int)a;
  NoFloatTest *= NoFloatTest;
  NoFloatTest++;
    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave this function */
}

#endif

⌨️ 快捷键说明

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