(MCUCR & 0xe3) | 1 << SE | read_uint8_t(&atm128PowerBits[powerState]);
sei();
- asm volatile ("sleep");
+ // All of memory may change at this point...
+ asm volatile ("sleep" : : : "memory");
cli();
}
MCUCR = temp;
}
sei();
- asm volatile ("sleep");
+ // All of memory may change at this point...
+ asm volatile ("sleep" : : : "memory");
cli();
}
SMCR =
(SMCR & 0xf0) | 1 << SE | read_uint8_t(&atm128PowerBits[powerState]);
sei();
- asm volatile ("sleep");
+ // All of memory may change at this point...
+ asm volatile ("sleep" : : : "memory");
cli();
CLR_BIT(SMCR, SE);
}
temp = msp430PowerBits[powerState] | SR_GIE;
__asm__ __volatile__( "bis %0, r2" : : "m" (temp) );
+ // All of memory may change at this point...
+ asm volatile ("" : : : "memory");
__nesc_disable_interrupt();
}
: "r" (PWRMODE_M_IDLE)
);
__nesc_enable_interrupt();
+ // All of memory may change at this point...
+ asm volatile ("" : : : "memory");
__nesc_disable_interrupt();
return;
}
NO_TASK = 255,
};
- volatile uint8_t m_head;
- volatile uint8_t m_tail;
- volatile uint8_t m_next[NUM_TASKS];
+ uint8_t m_head;
+ uint8_t m_tail;
+ uint8_t m_next[NUM_TASKS];
+
+#define v_head (*(volatile uint8_t *)&m_head)
// Helper functions (internal functions) intentionally do not have atomic
// sections. It is left as the duty of the exported interface functions to