sys_main.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /** @file sys_main.c
  2. * @brief Application main file
  3. * @date 29.May.2013
  4. * @version 03.05.02
  5. *
  6. * This file contains an empty main function,
  7. * which can be used for the application.
  8. */
  9. /* (c) Texas Instruments 2009-2013, All rights reserved. */
  10. /* USER CODE BEGIN (0) */
  11. /* we will use our own main and get rid off everything from HALCoGen here */
  12. #if 0
  13. #include <stdint.h>
  14. /* USER CODE END */
  15. /* Include Files */
  16. #include "sys_common.h"
  17. #include "system.h"
  18. /* USER CODE BEGIN (1) */
  19. /* Include HET header file - types, definitions and function declarations for system driver */
  20. #include "het.h"
  21. #include "esm.h"
  22. #include "sci.h"
  23. #include "rti.h"
  24. /* Task1 */
  25. void vTaskDelay(int t)
  26. {
  27. for (; t; t--)
  28. {
  29. int i;
  30. for(i = 100000;i ; i--)
  31. {
  32. }
  33. }
  34. }
  35. /* USER CODE END */
  36. /** @fn void main(void)
  37. * @brief Application main function
  38. * @note This function is empty by default.
  39. *
  40. * This function is called after startup.
  41. * The user can use this function to implement the application.
  42. */
  43. /* USER CODE BEGIN (2) */
  44. uint8_t sci_buf;
  45. /* USER CODE END */
  46. void main(void)
  47. {
  48. /* USER CODE BEGIN (3) */
  49. /* Set high end timer GIO port hetPort pin direction to all output */
  50. gioSetDirection(hetPORT1, 0xFFFFFFFF);
  51. sciInit();
  52. rtiInit();
  53. rtiStartCounter(rtiCOUNTER_BLOCK1);
  54. rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
  55. _enable_IRQ();
  56. sciReceive(scilinREG, 1, &sci_buf);
  57. for(;;)
  58. {
  59. gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
  60. /* Taggle HET[1] with timer tick */
  61. /*sciSendByte(scilinREG, 'b');*/
  62. vTaskDelay(100);
  63. /*sciSendByte(scilinREG, 'a');*/
  64. }
  65. /* USER CODE END */
  66. }
  67. /* USER CODE BEGIN (4) */
  68. #endif
  69. /* USER CODE END */