Commit 0911e508388637f7c1a2fcae6ff18184561c966f
authorMichel Pollet <buserror@gmail.com>
Wed, 27 Nov 2013 16:42:19 +0000 (16:42 +0000)
committerMichel Pollet <buserror@gmail.com>
Wed, 27 Nov 2013 16:42:19 +0000 (16:42 +0000)
Inspired by sealibora@github

Signed-off-by: Michel Pollet <buserror@gmail.com>
2 files changed:
simavr/cores/sim_megax.c
simavr/cores/sim_megax.h

index 80528e03b870c72feddf76c8941dab92a3a774d2..717bc7e40b76b21ab2388d0799c71087e8edc28d 100644 (file)
@@ -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);
index b80469dad39abe4db61d1bc501c3aa73d99bdb62..2ae1efbb5bb7e73ad1b18f287e3ab1a5675f85cc 100644 (file)
@@ -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,
        },