application.c 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. static rt_uint8_t user_thread_stack[512];
  18. static struct rt_thread user_thread;
  19. static void user_thread_entry(void *p)
  20. {
  21. int i;
  22. gioSetDirection(hetPORT1, 0xFFFFFFFF);
  23. for(i = 0; ;i++)
  24. {
  25. gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
  26. rt_thread_delay(100);
  27. }
  28. }
  29. int rt_application_init()
  30. {
  31. rt_thread_init(&user_thread, "user1", user_thread_entry, RT_NULL,
  32. user_thread_stack, sizeof(user_thread_stack), 21, 20);
  33. rt_thread_startup(&user_thread);
  34. return 0;
  35. }