X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=main.c;h=1b9bc971fca111c87614b7699955904608d813ed;hp=326ce64930ee66be51ad0e79e915e940ef4a43f9;hb=4d9670d6245cc381313a3ff41dd80f6596a266c8;hpb=49ab9eea94ed30f2b1ea6c731c2d42ac32d9650e diff --git a/main.c b/main.c index 326ce64..1b9bc97 100644 --- a/main.c +++ b/main.c @@ -91,7 +91,12 @@ void bootloader(void) /* return time in milliseconds on unsigned 16 bits */ static uint16_t get_time_ms(void) { - return (uint16_t)global_ms; + uint16_t ms; + uint8_t flags; + IRQ_LOCK(flags); + ms = global_ms; + IRQ_UNLOCK(flags); + return ms; } static void main_timer_interrupt(void)