avr_eeprom_init(avr, &mcu->eeprom);
avr_flash_init(avr, &mcu->selfprog);
avr_extint_init(avr, &mcu->extint);
+ avr_watchdog_init(avr, &mcu->watchdog);
avr_ioport_init(avr, &mcu->porta);
avr_ioport_init(avr, &mcu->portb);
avr_ioport_init(avr, &mcu->portc);
#include "sim_core_declare.h"
#include "avr_eeprom.h"
#include "avr_flash.h"
+#include "avr_watchdog.h"
#include "avr_extint.h"
#include "avr_ioport.h"
#include "avr_uart.h"
avr_t core;
avr_eeprom_t eeprom;
avr_flash_t selfprog;
+ avr_watchdog_t watchdog;
avr_extint_t extint;
avr_ioport_t porta, portb, portc, portd;
avr_uart_t uart0,uart1;
},
AVR_EEPROM_DECLARE(EE_READY_vect),
AVR_SELFPROG_DECLARE(SPMCSR, SPMEN, SPM_READY_vect),
+ AVR_WATCHDOG_DECLARE(WDTCSR, WDT_vect),
.extint = {
AVR_EXTINT_DECLARE(0, 'D', PD2),
AVR_EXTINT_DECLARE(1, 'D', PD3),
avr_eeprom_init(avr, &mcu->eeprom);
avr_flash_init(avr, &mcu->selfprog);
+ avr_watchdog_init(avr, &mcu->watchdog);
avr_extint_init(avr, &mcu->extint);
avr_ioport_init(avr, &mcu->portb);
avr_ioport_init(avr, &mcu->portc);
#include "sim_core_declare.h"
#include "avr_eeprom.h"
#include "avr_flash.h"
+#include "avr_watchdog.h"
#include "avr_extint.h"
#include "avr_ioport.h"
#include "avr_uart.h"
struct mcu_t {
avr_t core;
avr_eeprom_t eeprom;
+ avr_watchdog_t watchdog;
avr_flash_t selfprog;
avr_extint_t extint;
avr_ioport_t portb,portc,portd;
},
AVR_EEPROM_DECLARE(EE_READY_vect),
AVR_SELFPROG_DECLARE(SPMCSR, SELFPRGEN, SPM_READY_vect),
+ AVR_WATCHDOG_DECLARE(WDTCSR, WDT_vect),
.extint = {
AVR_EXTINT_DECLARE(0, 'D', 2),
AVR_EXTINT_DECLARE(1, 'D', 3),
#include "sim_avr.h"
#include "sim_core_declare.h"
#include "avr_eeprom.h"
+#include "avr_watchdog.h"
+#include "avr_extint.h"
#include "avr_ioport.h"
#include "avr_timer.h"
static struct mcu_t {
avr_t core;
avr_eeprom_t eeprom;
+ avr_watchdog_t watchdog;
+ avr_extint_t extint;
avr_ioport_t portb;
avr_timer_t timer0;
} mcu = {
.reset = reset,
},
AVR_EEPROM_DECLARE_8BIT(EE_RDY_vect),
+ // tiny13 has different names for these...
+ #define WDIF WDTIF
+ #define WDIE WDTIE
+ AVR_WATCHDOG_DECLARE(WDTCR, WDT_vect),
+ .extint = {
+ AVR_EXTINT_TINY_DECLARE(0, 'B', 1, GIFR),
+ },
.portb = {
.name = 'B', .r_port = PORTB, .r_ddr = DDRB, .r_pin = PINB,
.pcint = {
printf("%s init\n", avr->mmcu);
avr_eeprom_init(avr, &mcu->eeprom);
+ avr_watchdog_init(avr, &mcu->watchdog);
+ avr_extint_init(avr, &mcu->extint);
avr_ioport_init(avr, &mcu->portb);
avr_timer_init(avr, &mcu->timer0);
}
#include </usr/include/stdio.h>
#include "sim_core_declare.h"
#include "avr_eeprom.h"
+#include "avr_watchdog.h"
#include "avr_extint.h"
#include "avr_ioport.h"
#include "avr_uart.h"
static struct mcu_t {
avr_t core;
avr_eeprom_t eeprom;
+ avr_watchdog_t watchdog;
avr_extint_t extint;
avr_ioport_t portb, portd;
avr_uart_t uart;
.reset = reset,
},
AVR_EEPROM_DECLARE_8BIT(EEPROM_READY_vect),
+ AVR_WATCHDOG_DECLARE(WDTCSR, WDT_OVERFLOW_vect),
.extint = {
AVR_EXTINT_TINY_DECLARE(0, 'D', 2, EIFR),
AVR_EXTINT_TINY_DECLARE(1, 'D', 3, EIFR),
printf("%s init\n", avr->mmcu);
avr_eeprom_init(avr, &mcu->eeprom);
+ avr_watchdog_init(avr, &mcu->watchdog);
+ avr_extint_init(avr, &mcu->extint);
avr_ioport_init(avr, &mcu->portb);
avr_ioport_init(avr, &mcu->portd);
avr_uart_init(avr, &mcu->uart);
printf("%s init\n", avr->mmcu);
avr_eeprom_init(avr, &mcu->eeprom);
+ avr_watchdog_init(avr, &mcu->watchdog);
avr_extint_init(avr, &mcu->extint);
avr_ioport_init(avr, &mcu->portb);
avr_adc_init(avr, &mcu->adc);
#include "sim_core_declare.h"
#include "avr_eeprom.h"
+#include "avr_watchdog.h"
#include "avr_extint.h"
#include "avr_ioport.h"
#include "avr_adc.h"
struct mcu_t {
avr_t core;
avr_eeprom_t eeprom;
+ avr_watchdog_t watchdog;
avr_extint_t extint;
avr_ioport_t portb;
avr_adc_t adc;
.reset = tx5_reset,
},
AVR_EEPROM_DECLARE(EE_RDY_vect),
+ AVR_WATCHDOG_DECLARE(WDTCR, WDT_vect),
.extint = {
AVR_EXTINT_TINY_DECLARE(0, 'B', PB2, GIFR),
},