sys_main.c 1.7 KB
Newer Older
G
Grissiom 已提交
1 2
/** @file sys_main.c 
*   @brief Application main file
G
Grissiom 已提交
3 4
*   @date 29.May.2013
*   @version 03.05.02
G
Grissiom 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
*
*   This file contains an empty main function,
*   which can be used for the application.
*/

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

/* USER CODE BEGIN (0) */
/* we will use our own main and get rid off everything from HALCoGen here */
#if 0
#include <stdint.h>
/* USER CODE END */

/* Include Files */

#include "sys_common.h"
#include "system.h"

/* USER CODE BEGIN (1) */

/* Include HET header file - types, definitions and function declarations for system driver */
#include "het.h"
#include "esm.h"
#include "sci.h"
#include "rti.h"

/* Task1 */
void vTaskDelay(int t)
{
    for (; t; t--)
    {
        int i;
        for(i = 100000;i ; i--)
        {
        }
    }
}
/* 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) */
uint8_t sci_buf;
/* USER CODE END */

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

    /* Set high end timer GIO port hetPort pin direction to all output */
    gioSetDirection(hetPORT1, 0xFFFFFFFF);
    sciInit();
    rtiInit();
    rtiStartCounter(rtiCOUNTER_BLOCK1);
    rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
    _enable_IRQ();
    sciReceive(scilinREG, 1, &sci_buf);

    for(;;)
    {
        gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
        /* Taggle HET[1] with timer tick */
        /*sciSendByte(scilinREG, 'b');*/
        vTaskDelay(100);
        /*sciSendByte(scilinREG, 'a');*/
    }
/* USER CODE END */
}

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