//
// if RX is enabled, and there is nothing to read, and
// the AVR core is reading this register, it's probably
- // to pool the RXC TXC flag and spinloop
+ // to poll the RXC TXC flag and spinloop
// so here we introduce a usleep to make it a bit lighter
// on CPU and let data arrive
//
{
avr_uart_t * p = (avr_uart_t *)param;
- // clear the rxc bit in case the code is using pooling
+ // clear the rxc bit in case the code is using polling
avr_regbit_clear(avr, p->rxc.raised);
if (!avr_regbit_get(avr, p->rxen)) {
printf(" -t: run full scale decoder trace\n"
" -g: listen for gdb connection on port 1234\n"
" -ff: Loads next .hex file as flash\n"
- " -ee: Loads next .hec file as eeprom\n"
+ " -ee: Loads next .hex file as eeprom\n"
" Supported AVR cores:\n");
for (int i = 0; avr_kind[i]; i++) {
printf(" ");
hook = irq->hook;
prev = NULL;
while (hook) {
- if (hook->notify == notify && hook->param == param)
- {
+ if (hook->notify == notify && hook->param == param) {
if ( prev )
prev->next = hook->next;
else
hook = src->hook;
prev = NULL;
while (hook) {
- if (hook->chain == dst)
- {
+ if (hook->chain == dst) {
if ( prev )
prev->next = hook->next;
else
+++ /dev/null
-/*
- atmega88_example.c
-
- */
-
-#ifndef F_CPU
-#define F_CPU 8000000
-#endif
-#include <avr/io.h>
-#include <stdio.h>
-#include <avr/interrupt.h>
-#include <avr/eeprom.h>
-#include <avr/sleep.h>
-#include <util/delay.h>
-
-/*
- * This demonstrate how to use the avr_mcu_section.h file
- * The macro adds a section to the ELF file with useful
- * information for the simulator
- */
-#include "avr_mcu_section.h"
-AVR_MCU(F_CPU, "atmega88");
-
-
-int main()
-{
- DDRB = 1;
- PORTB = 0;
-
-
- // test VCD output for 100us
- for(int i=0; i<10; i++)
- {
- PORTB = 1 ^ PORTB;
- _delay_us(100);
- }
-
-
- // this quits the simulator, since interupts are off
- // this is a "feature" that allows running tests cases and exit
- sleep_cpu();
-}
+++ /dev/null
-#include "sim_avr.h"
-#include "avr_ioport.h"
-#include "sim_vcd_file.h"
-
-#include "tests.h"
-
-int main(int argc, char **argv) {
- tests_init(argc, argv);
-
-
- avr_t *avr = tests_init_avr("atmega88_vcd.axf");
-
- avr_vcd_t vcd_file;
- avr_vcd_init(avr, "atmega88_vcd.vcd", &vcd_file, 10000);
- avr_vcd_add_signal(&vcd_file, avr_io_getirq(avr, AVR_IOCTL_IOPORT_GETIRQ('B'), IOPORT_IRQ_PIN0), 1, "PB0" );
- avr_vcd_start(&vcd_file);
-
- tests_run_test(avr, 10000);
-
- avr_vcd_stop(&vcd_file);
- tests_success();
- return 0;
-}