From: Michel Pollet Date: Sun, 9 Feb 2014 23:12:11 +0000 (+0000) Subject: cores: m16 and m32 fix X-Git-Tag: v1.2~39 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=6c2879d4c25c143ca72d3fa7d5247fe695d8177f;p=sx%2Fsimavr.git cores: m16 and m32 fix Core struct declaration had a problem when the 'porta' was not declared. Now declare it last, so it doesnt clash anymore. --- diff --git a/simavr/cores/sim_megax.h b/simavr/cores/sim_megax.h index 2ae1efb..1cfaa07 100644 --- a/simavr/cores/sim_megax.h +++ b/simavr/cores/sim_megax.h @@ -46,15 +46,16 @@ 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; avr_timer_t timer0,timer1,timer2; avr_spi_t spi; avr_twi_t twi; + // PORTA exists on m16 and 32, but not on 8. + // It is still necessary to declare this as otherwise + // the core_megax shared constructor will be confused + avr_ioport_t porta; }; #ifdef SIM_CORENAME @@ -102,7 +103,6 @@ const struct mcu_t SIM_CORENAME = { .portd = { .name = 'D', .r_port = PORTD, .r_ddr = DDRD, .r_pin = PIND, }, - .uart = { // no PRUSART .disabled = AVR_IO_REGBIT(PRR,PRUSART0), .name = '0',