cores: Now duplicate the global structure
[simavr] / simavr / cores / sim_tiny2313.c
index faeffd1..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;
@@ -214,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 = {