application.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <sdk.h>
  17. #include <core/ccm_pll.h>
  18. void show_freq(void)
  19. {
  20. rt_kprintf("CPU: %d MHz\n", get_main_clock(CPU_CLK)/1000000);
  21. rt_kprintf("DDR: %d MHz\n", get_main_clock(MMDC_CH0_AXI_CLK)/1000000);
  22. rt_kprintf("IPG: %d MHz\n", get_main_clock(IPG_CLK)/1000000);
  23. }
  24. void init_thread(void* parameter)
  25. {
  26. rt_kprintf("Freescale i.MX6 Platform SDK %s\n", SDK_VERSION_STRING);
  27. show_freq();
  28. rt_components_init();
  29. }
  30. int rt_application_init()
  31. {
  32. rt_thread_t tid;
  33. tid = rt_thread_create("init", init_thread, RT_NULL,
  34. 1024, RT_THREAD_PRIORITY_MAX/3, 10);
  35. if (tid != RT_NULL) rt_thread_startup(tid);
  36. return 0;
  37. }