2 atmega328p_dummy_blinky.c
4 Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
6 This file is part of simavr.
8 simavr is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 simavr is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with simavr. If not, see <http://www.gnu.org/licenses/>.
27 #define F_CPU 16000000
31 #include <avr/interrupt.h>
32 #include <avr/eeprom.h>
33 #include <avr/sleep.h>
36 * This demonstrate how to use the avr_mcu_section.h file
37 * The macro adds a section to the ELF file with useful
38 * information for the simulator
40 #include "avr_mcu_section.h"
41 AVR_MCU(F_CPU, "atmega328p");
43 static int uart_putchar(char c, FILE *stream) {
45 uart_putchar('\r', stream);
46 loop_until_bit_is_set(UCSR0A, UDRE0);
51 static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,
59 printf("Bootloader properly programmed, and ran me! Huzzah!\n");
61 // this quits the simulator, since interrupts are off
62 // this is a "feature" that allows running tests cases and exit