adding critical section code for msp430