cores: Now duplicate the global structure
[simavr] / simavr / cores / sim_mega1280.c
index e943cf9..3f60e7c 100755 (executable)
@@ -46,7 +46,7 @@ void m1280_reset(struct avr_t * avr);
 /*
  * This is a template for all of the 1280 devices, hopefully
  */
-struct mcu_t {
+const struct mcu_t {
        avr_t          core;
        avr_eeprom_t    eeprom;
        avr_flash_t     selfprog;
@@ -596,7 +596,7 @@ struct mcu_t {
 
 static avr_t * make()
 {
-        return &mcu_mega1280.core;
+       return avr_core_allocate(&mcu_mega1280.core, sizeof(struct mcu_t));
 }
 
 avr_kind_t mega1280 = {