tutor.c
来自「<<AVR C语言的应用>>第九章中的例子 用ATme」· C语言 代码 · 共 50 行
C
50 行
/**************************************************
*
* 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 + =
减小字号Ctrl + -
显示快捷键?