/*******************************************************************************
 *  flash_secure.c - Flash locking 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_secure(void)
{
    _DINT();
    FCTL1 = FWKEY;                      /* Erase, write = 0 */
    FCTL3 = FWKEY | LOCK;
    _EINT();
}
#endif
