core: Don't sleep with pending interrupts
[simavr] / simavr / cores / sim_90usb162.c
index c160181..974e280 100644 (file)
@@ -40,7 +40,7 @@ void usb162_reset(struct avr_t * avr);
 #define __ASSEMBLER__
 #include "avr/iousb162.h"
 
-struct mcu_t {
+const struct mcu_t {
        avr_t                    core;
        avr_eeprom_t    eeprom;
        avr_flash_t     selfprog;
@@ -261,7 +261,7 @@ struct mcu_t {
 
 static avr_t * make()
 {
-       return &mcu_usb162.core;
+       return avr_core_allocate(&mcu_usb162.core, sizeof(struct mcu_t));
 }
 
 avr_kind_t usb162 = {
@@ -273,8 +273,6 @@ void usb162_init(struct avr_t * avr)
 {
        struct mcu_t * mcu = (struct mcu_t*)avr;
 
-       printf("%s init\n", avr->mmcu);
-
        avr_eeprom_init(avr, &mcu->eeprom);
        avr_flash_init(avr, &mcu->selfprog);
        avr_extint_init(avr, &mcu->extint);