platform.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_POSIX
  13. #error "simulator does not support RT_USING_POSIX"
  14. #endif
  15. #ifdef RT_USING_LIBC
  16. #error "simulator does not support RT_USING_LIBC"
  17. #endif
  18. int platform_init(void)
  19. {
  20. #ifdef RT_USING_LWIP
  21. #ifdef RT_USING_TAPNETIF
  22. tap_netif_hw_init();
  23. #else
  24. pcap_netif_hw_init();
  25. #endif
  26. #endif
  27. #ifdef RT_USING_DFS
  28. /* initialize sd card */
  29. rt_hw_sdcard_init();
  30. #if defined(RT_USING_MTD_NAND)
  31. rt_hw_mtd_nand_init();
  32. #endif
  33. #if defined(RT_USING_MTD_NOR)
  34. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  35. #endif
  36. #endif /* RT_USING_DFS */
  37. return 0;
  38. }
  39. INIT_COMPONENT_EXPORT(platform_init);
  40. int platform_post_init(void)
  41. {
  42. #ifdef PKG_USING_GUIENGINE
  43. {
  44. extern void rt_hw_sdl_start(void);
  45. extern int rtgui_system_server_init(void);
  46. rtgui_system_server_init();
  47. rt_hw_sdl_start();
  48. }
  49. #endif
  50. return 0;
  51. }
  52. INIT_COMPONENT_EXPORT(platform_post_init);