application.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * File : app.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2013, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2013-05-24 Grissiom first version
  13. */
  14. #include <rtthread.h>
  15. #include "system.h"
  16. #include "het.h"
  17. int ulRegTest1Counter;
  18. int ulRegTest2Counter;
  19. void vPortTaskUsesFPU()
  20. {
  21. }
  22. static rt_uint8_t user_thread_stack[512];
  23. static struct rt_thread user_thread;
  24. static void user_thread_entry(void *p)
  25. {
  26. gioSetDirection(hetPORT1, 0xFFFFFFFF);
  27. for(;;)
  28. {
  29. gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
  30. /* Taggle HET[1] with timer tick */
  31. /*sciSendByte(scilinREG, 'b');*/
  32. rt_thread_delay(100);
  33. /*sciSendByte(scilinREG, 'a');*/
  34. }
  35. }
  36. static rt_uint8_t test_thread_stack[512];
  37. static struct rt_thread test_thread;
  38. void vRegTestTask1(void*);
  39. int rt_application_init()
  40. {
  41. rt_thread_init(&user_thread, "user1", user_thread_entry, RT_NULL,
  42. user_thread_stack, sizeof(user_thread_stack), 8, 20);
  43. rt_thread_startup(&user_thread);
  44. rt_thread_init(&test_thread, "test1", vRegTestTask1, RT_NULL,
  45. test_thread_stack, sizeof(test_thread_stack), 8, 20);
  46. rt_thread_startup(&test_thread);
  47. return 0;
  48. }