platform.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #include <rtthread.h>
  10. #include "board.h"
  11. #include <shell.h>
  12. #ifdef RT_USING_LIBC
  13. #error "simulator does not support RT_USING_LIBC"
  14. #endif
  15. int platform_init(void)
  16. {
  17. #ifdef RT_USING_LWIP
  18. #ifdef RT_USING_TAPNETIF
  19. tap_netif_hw_init();
  20. #else
  21. pcap_netif_hw_init();
  22. #endif
  23. #endif
  24. #ifdef RT_USING_DFS
  25. /* initialize sd card */
  26. rt_hw_sdcard_init();
  27. #if defined(RT_USING_MTD_NAND)
  28. rt_hw_mtd_nand_init();
  29. #endif
  30. #if defined(RT_USING_MTD_NOR)
  31. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  32. #endif
  33. #endif /* RT_USING_DFS */
  34. return 0;
  35. }
  36. INIT_COMPONENT_EXPORT(platform_init);
  37. int platform_post_init(void)
  38. {
  39. #ifdef PKG_USING_GUIENGINE
  40. {
  41. extern void rt_hw_sdl_start(void);
  42. extern int rtgui_system_server_init(void);
  43. rtgui_system_server_init();
  44. rt_hw_sdl_start();
  45. }
  46. #endif
  47. return 0;
  48. }
  49. INIT_COMPONENT_EXPORT(platform_post_init);