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

📄 tutor.c

📁 <<AVR C语言的应用>>第九章中的例子 用ATmega1280 在IAR Embedded Workbench IDE平台编译连接通过的12个程序
💻 C
字号:
/**************************************************
 *
 * IAR EMBEDDED WORKBENCH TUTORIAL
 * C tutorial. Print the Fibonacci numbers.
 *
 * Copyright 1996 - 2003 IAR Systems. All rights reserved.
 *
 * $Revision: 1.3 $
 *
 **************************************************/


#include "Tutor.h"


  /* Global call counter */
int call_count;

/*
    Increase the 'call_count' variable by one.
*/
void next_counter(void)
{
  call_count += 1;      /* from d_f_p */
}

/*
    Increase the 'call_count' variable.
    Get and print the associated Fibonacci number.
*/
void do_foreground_process(void)
{
  unsigned int fib;
  next_counter();
  fib = get_fib( call_count );
  put_fib( fib );
}

/*
    Main program.
    Prints the Fibonacci numbers.
*/
void main(void)
{
 call_count = 0;
 init_fib();
 while (  call_count < MAX_FIB )
   do_foreground_process();
}

⌨️ 快捷键说明

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