application.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * File : app.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, 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. * 2009-01-05 Bernard the first version
  13. */
  14. /**
  15. * @addtogroup LM3S
  16. */
  17. /*@{*/
  18. #include <rthw.h>
  19. #include <rtthread.h>
  20. char thread1_stack[0x120];
  21. struct rt_thread thread1;
  22. void thread1_entry(void* parameter)
  23. {
  24. rt_uint32_t i = 0;
  25. while (1)
  26. {
  27. rt_kprintf("thread1 --> %d\n", ++i);
  28. rt_thread_delay(100);
  29. }
  30. }
  31. void thread_test()
  32. {
  33. rt_thread_init(&thread1,
  34. "thread1",
  35. thread1_entry, RT_NULL,
  36. &thread1_stack[0], sizeof(thread1_stack),
  37. 20, 15);
  38. rt_thread_startup(&thread1);
  39. }
  40. #ifdef RT_USING_FINSH
  41. #include <finsh.h>
  42. FINSH_FUNCTION_EXPORT(thread_test, test a basic thread)
  43. #endif
  44. int rt_application_init()
  45. {
  46. return 0;
  47. }
  48. /*@}*/