From: Michel Pollet Date: Tue, 10 Aug 2010 21:51:31 +0000 (+0100) Subject: core: Add PORTA support for Attiny2313 X-Git-Tag: v1.0a5~5 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=f4b8df2dc232bc3f111c27212e54b6cbb8fe6851;p=sx%2Fsimavr.git core: Add PORTA support for Attiny2313 The Attiny2313 has a PORTA, the pins for it are normally used for reset and the crystal, but it is possible to use them if you use the internal R/C oscilator. Simavr didn't support this port on a Attiny2313 yet, so I added it myself. Signed-off-by: Wander Winkelhorst Signed-off-by: Michel Pollet --- diff --git a/simavr/cores/sim_tiny2313.c b/simavr/cores/sim_tiny2313.c index e0af609..d9136f3 100644 --- a/simavr/cores/sim_tiny2313.c +++ b/simavr/cores/sim_tiny2313.c @@ -43,7 +43,7 @@ static struct mcu_t { avr_eeprom_t eeprom; avr_watchdog_t watchdog; avr_extint_t extint; - avr_ioport_t portb, portd; + avr_ioport_t porta, portb, portd; avr_uart_t uart; avr_timer_t timer0,timer1; } mcu = { @@ -60,6 +60,9 @@ static struct mcu_t { AVR_EXTINT_TINY_DECLARE(0, 'D', 2, EIFR), AVR_EXTINT_TINY_DECLARE(1, 'D', 3, EIFR), }, + .porta = { // port A has no PCInts.. + .name = 'A', .r_port = PORTA, .r_ddr = DDRA, .r_pin = PINA, + }, .portb = { .name = 'B', .r_port = PORTB, .r_ddr = DDRB, .r_pin = PINB, .pcint = { @@ -226,6 +229,7 @@ static void init(struct avr_t * avr) avr_eeprom_init(avr, &mcu->eeprom); avr_watchdog_init(avr, &mcu->watchdog); avr_extint_init(avr, &mcu->extint); + avr_ioport_init(avr, &mcu->porta); avr_ioport_init(avr, &mcu->portb); avr_ioport_init(avr, &mcu->portd); avr_uart_init(avr, &mcu->uart);