X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=simavr%2Fsim%2Fsim_avr.h;h=737b3ce9bc1862619f49c87e0d66d3efe4570372;hb=33cb87d48ecd68f2000d02659bb3752a329274c8;hp=199af292309160e76fec637a34e379c68a908799;hpb=2cf07567ba52d3606e53e395fac259caf8ace2e1;p=simavr diff --git a/simavr/sim/sim_avr.h b/simavr/sim/sim_avr.h index 199af29..737b3ce 100644 --- a/simavr/sim/sim_avr.h +++ b/simavr/sim/sim_avr.h @@ -55,7 +55,7 @@ enum { R_SREG = 32+0x3f, // maximum number of IO registers, on normal AVRs - MAX_IOs = 256, // Bigger AVRs need more than 256-32 (mega1280) + MAX_IOs = 279, // Bigger AVRs need more than 256-32 (mega1280) }; #define AVR_DATA_TO_IO(v) ((v) - 32) @@ -139,6 +139,13 @@ typedef struct avr_t { // not only to "cycles that runs" but also "cycles that might have run" // like, sleeping. avr_cycle_count_t cycle; // current cycle + + /** + * Sleep requests are accumulated in sleep_usec until the minimum sleep value + * is reached, at which point sleep_usec is cleared and the sleep request + * is passed on to the operating system. + */ + uint32_t sleep_usec; // called at init time void (*init)(struct avr_t * avr); @@ -238,7 +245,7 @@ typedef struct avr_t { avr_int_table_t interrupts; // DEBUG ONLY -- value ignored if CONFIG_SIMAVR_TRACE = 0 - int trace : 1, + uint8_t trace : 1, log : 2; // log level, default to 1 // Only used if CONFIG_SIMAVR_TRACE is defined