misc: Fix confusing typo in error message
[simavr] / simavr / cores / sim_tiny2313.c
index d9136f3..0a8ed6c 100644 (file)
@@ -38,7 +38,7 @@ static void reset(struct avr_t * avr);
 /*
  * This is a template for all of the tinyx5 devices, hopefully
  */
-static struct mcu_t {
+const static struct mcu_t {
        avr_t core;
        avr_eeprom_t    eeprom;
        avr_watchdog_t  watchdog;
@@ -83,6 +83,8 @@ static struct mcu_t {
 
                .txen = AVR_IO_REGBIT(UCSRB, TXEN),
                .rxen = AVR_IO_REGBIT(UCSRB, RXEN),
+               .ucsz = AVR_IO_REGBITS(UCSRC, UCSZ0, 0x3), // 2 bits
+               .ucsz2 = AVR_IO_REGBIT(UCSRB, UCSZ2),   // 1 bits
 
                .r_ucsra = UCSRA,
                .r_ucsrb = UCSRB,
@@ -212,7 +214,7 @@ static struct mcu_t {
 
 static avr_t * make()
 {
-       return &mcu.core;
+       return avr_core_allocate(&mcu.core, sizeof(struct mcu_t));
 }
 
 avr_kind_t tiny2313 = {