/*******************************************************************************
 *  flash_write_int32.c - Flash write 32 bit routines.
 *
 *  Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 
 *  ALL RIGHTS RESERVED 
 * 
*/

#include <signal.h>
#include <inttypes.h>
#if defined(__MSP430__)
#include <msp430.h>
#endif
#include "emeter-toolkit.h"

#if defined(__MSP430__)
void flash_write_int32(int32_t *ptr, int32_t value)
{
    _DINT();
    FCTL3 = FWKEY;                      /* Lock = 0 */
    FCTL1 = FWKEY | WRT;
    *((int32_t *) ptr) = value;         /* Program the flash */
}
#endif
