application.c 763 B

123456789101112131415161718192021222324252627282930313233343536
  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 <stdlib.h>
  15. #include <rtthread.h>
  16. #include <components.h>
  17. #ifdef RT_USING_GDB
  18. #include <gdb_stub.h>
  19. #endif
  20. int rt_application_init()
  21. {
  22. /* do component initialization */
  23. rt_components_init();
  24. #ifdef RT_USING_NEWLIB
  25. libc_system_init(RT_CONSOLE_DEVICE_NAME);
  26. #endif
  27. #ifdef RT_USING_GDB
  28. gdb_set_device("uart4");
  29. gdb_start();
  30. #endif
  31. return 0;
  32. }