void mx4_init(struct avr_t * avr)
{
struct mcu_t * mcu = (struct mcu_t*)avr;
-
+
avr_eeprom_init(avr, &mcu->eeprom);
avr_flash_init(avr, &mcu->selfprog);
avr_extint_init(avr, &mcu->extint);
avr_timer_init(avr, &mcu->timer0);
avr_timer_init(avr, &mcu->timer1);
avr_timer_init(avr, &mcu->timer2);
-#ifdef PRR1
- avr_timer_init(avr, &mcu->timer3);
-#endif
+ if (mcu->timer3.name) // only resent on 1284
+ avr_timer_init(avr, &mcu->timer3);
+
avr_spi_init(avr, &mcu->spi);
avr_twi_init(avr, &mcu->twi);
}
avr_uart_t uart0,uart1;
avr_adc_t adc;
avr_timer_t timer0,timer1,timer2;
-#ifdef PRR1
avr_timer_t timer3;
-#endif
avr_spi_t spi;
avr_twi_t twi;
};
.cs_div = { 0, 0, 3 /* 8 */, 5 /* 32 */, 6 /* 64 */, 7 /* 128 */, 8 /* 256 */, 10 /* 1024 */ },
.r_tcnt = TCNT2,
-
+
// asynchronous timer source bit.. if set, use 32khz frequency
.as2 = AVR_IO_REGBIT(ASSR, AS2),
-
+
.overflow = {
.enable = AVR_IO_REGBIT(TIMSK2, TOIE2),
.raised = AVR_IO_REGBIT(TIFR2, TOV2),