/** @file sys_main.c 
*   @brief Application main file
*   @date 20.May.2014
*   @version 04.00.00
*
*   This file contains an empty main function,
*   which can be used for the application.
*/

/* (c) Texas Instruments 2009-2014, All rights reserved. */

/* USER CODE BEGIN (0) */
/* USER CODE END */

/* Include Files */

#include "sys_common.h"

/* USER CODE BEGIN (1) */
#include "gio.h"
#include "reg_het.h"
#include "rti.h"
/* USER CODE END */

/** @fn void main(void)
*   @brief Application main function
*   @note This function is empty by default.
*
*   This function is called after startup.
*   The user can use this function to implement the application.
*/

/* USER CODE BEGIN (2) */
/* USER CODE END */

void main(void)
{
/* USER CODE BEGIN (3) */
	gioInit();

	gioSetDirection(gioPORTA, 1ull << 2); /* Enable GIOA2   output buffer */
	gioSetDirection(hetPORT1, 1ull << 8); /* Enable N2HET08 output buffer */

	gioSetBit(gioPORTA, 2ull, 0ull); /* Switch off LED D12 */
	gioSetBit(hetPORT1, 8ull, 0ull); /* Switch off LED D11 */

	rtiInit();

	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
	rtiEnableNotification(rtiNOTIFICATION_COMPARE1);

	rtiStartCounter(rtiCOUNTER_BLOCK0);

	_enable_IRQ();

	while(1);
/* USER CODE END */
}

/* USER CODE BEGIN (4) */
/* USER CODE END */
