f51bce3fed
We currently only support building with CCS and SCons is not using. bsp/rm48x50/HALCoGen/HALCoGen.{hcg,dil} is the HALCoGen project file. You may need to regenerate the source file as you like, providing that: 1, IRQ is in Dispatch Mode and the table entry is IRQ_Handler. The channel 5 in enabled and connected to IRQ. 2, RTI driver is enabled and compare3 source is selected to counter1 and the compare3 will generate tick in the period of 10ms. This value is coresponding with RT_TICK_PER_SECOND in rtconfig.h. In CCS, you need to create a new CCS project and create link folders pointing at bsp/rm48x50, libcpu/arm/rm48x50 and src/, include/. Remember to add the include path to the Build Properties.
83 lines
1.7 KiB
C
83 lines
1.7 KiB
C
/** @file sys_main.c
|
|
* @brief Application main file
|
|
* @date 23.May.2013
|
|
* @version 03.05.01
|
|
*
|
|
* 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 */
|