application.c 924 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * File : application.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, 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://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2012-11-20 Bernard the first version
  13. */
  14. #include <rtthread.h>
  15. #include <components.h>
  16. #include <pthread.h>
  17. void *test_task(void *parameter)
  18. {
  19. int count = 0;
  20. while (1)
  21. {
  22. rt_thread_delay(RT_TICK_PER_SECOND);
  23. rt_kprintf("count = %d\n", count ++);
  24. }
  25. return RT_NULL;
  26. }
  27. int rt_application_init()
  28. {
  29. // pthread_t tid;
  30. /* do component initialization */
  31. rt_components_init();
  32. #ifdef RT_USING_NEWLIB
  33. libc_system_init(RT_CONSOLE_DEVICE_NAME);
  34. #endif
  35. // pthread_create(&tid, RT_NULL, test_task, RT_NULL);
  36. return 0;
  37. }