From: Michel Pollet Date: Wed, 27 Nov 2013 16:42:19 +0000 (+0000) Subject: cores: Added PORTA to atmega32 X-Git-Tag: v1.2~54 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=0911e508388637f7c1a2fcae6ff18184561c966f;p=sx%2Fsimavr.git cores: Added PORTA to atmega32 Inspired by sealibora@github Signed-off-by: Michel Pollet --- diff --git a/simavr/cores/sim_megax.c b/simavr/cores/sim_megax.c index 80528e0..717bc7e 100644 --- a/simavr/cores/sim_megax.c +++ b/simavr/cores/sim_megax.c @@ -32,6 +32,9 @@ void mx_init(struct avr_t * avr) avr_flash_init(avr, &mcu->selfprog); avr_watchdog_init(avr, &mcu->watchdog); avr_extint_init(avr, &mcu->extint); +#ifdef PORTA + avr_ioport_init(avr, &mcu->porta); +#endif avr_ioport_init(avr, &mcu->portb); avr_ioport_init(avr, &mcu->portc); avr_ioport_init(avr, &mcu->portd); diff --git a/simavr/cores/sim_megax.h b/simavr/cores/sim_megax.h index b80469d..2ae1efb 100644 --- a/simavr/cores/sim_megax.h +++ b/simavr/cores/sim_megax.h @@ -46,6 +46,9 @@ struct mcu_t { avr_flash_t selfprog; avr_watchdog_t watchdog; avr_extint_t extint; +#ifdef PORTA + avr_ioport_t porta; +#endif avr_ioport_t portb, portc, portd; avr_uart_t uart; avr_adc_t adc; @@ -85,6 +88,11 @@ const struct mcu_t SIM_CORENAME = { AVR_EXTINT_DECLARE(0, 'D', PD2), AVR_EXTINT_DECLARE(1, 'D', PD3), }, +#ifdef PORTA + .porta = { + .name = 'A', .r_port = PORTA, .r_ddr = DDRA, .r_pin = PINA, + }, +#endif .portb = { .name = 'B', .r_port = PORTB, .r_ddr = DDRB, .r_pin = PINB, },