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