1
0

application.c 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2012-11-20 Bernard the first version
  9. */
  10. #include <rtthread.h>
  11. #include <sdk_version.h>
  12. #include <ccm_pll.h>
  13. void show_freq(void)
  14. {
  15. rt_kprintf("CPU: %d MHz\n", get_main_clock(CPU_CLK)/1000000);
  16. rt_kprintf("DDR: %d MHz\n", get_main_clock(MMDC_CH0_AXI_CLK)/1000000);
  17. rt_kprintf("IPG: %d MHz\n", get_main_clock(IPG_CLK)/1000000);
  18. }
  19. void init_thread(void* parameter)
  20. {
  21. rt_kprintf("Freescale i.MX6 Platform SDK %s\n", SDK_VERSION_STRING);
  22. show_freq();
  23. rt_components_init();
  24. }
  25. int rt_application_init()
  26. {
  27. rt_thread_t tid;
  28. tid = rt_thread_create("init", init_thread, RT_NULL,
  29. 1024, RT_THREAD_PRIORITY_MAX/3, 10);
  30. if (tid != RT_NULL) rt_thread_startup(tid);
  31. return 0;
  32. }