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

📄 ledtest.c

📁 AVR的引导程序。 chip45boot s-record bootloader.
💻 C
字号:
//
// ledtest.c
//
// simple test program for the bootloader 
//
// Copyright 2006 by Erik Lins, www.chip45.com
//
// Subversion keywords
//
// $Rev: 11 $
// $Date: 2006-05-23 16:04:42 +0200 (Di, 23 Mai 2006) $
// $Author: linserik $
//


// includes
#include <avr/io.h>


// defines
#define LED_DDR  DDRB
#define LED_PORT PORTB
#define LED_PIN  PINB
#define LED      PINB2


//
// main function
//
int main(void) {

    uint32_t l;

    // set LED pin to output and switch on LED
    LED_DDR |= _BV(LED);
    LED_PORT &= ~_BV(LED);

    // endless loop, blink LED
    while(1) {
	LED_PORT &= ~_BV(LED);
	for(l = 0; l < (F_CPU / 5); ++l);
	LED_PORT |= _BV(LED);
	for(l = 0; l < (2 * F_CPU); ++l);
    }
}


//
// end of file ledtest.c
////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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