diff --git a/bsp/simulator/Kconfig b/bsp/simulator/Kconfig index bb19d9575f8e5bc02986f7e23bf7338c8f4408bb..7338408a0371a4ef15ab42a315420d94a26ccb44 100644 --- a/bsp/simulator/Kconfig +++ b/bsp/simulator/Kconfig @@ -31,7 +31,9 @@ config RT_USING_DFS_WINSHAREDIR config BSP_USING_SAL_WINSOCK bool "Enable Windows socket (winsock) with SAL" - select RT_USING_SAL + select RT_USING_POSIX_FS + select RT_USING_POSIX_SOCKET + select SAL_USING_WINSOCK default n config BSP_USING_LVGL diff --git a/bsp/simulator/applications/platform.c b/bsp/simulator/applications/platform.c index 3af1e16a8a8f1647f5bd528cb6c17da4ca57d325..da0d6151339f54abacf6d059ee48bfd99ed99695 100644 --- a/bsp/simulator/applications/platform.c +++ b/bsp/simulator/applications/platform.c @@ -23,13 +23,13 @@ int platform_init(void) /* initialize sd card */ rt_hw_sdcard_init(); -#if defined(RT_USING_MTD_NAND) +#ifdef RT_USING_MTD_NAND rt_hw_mtd_nand_init(); -#endif +#endif /* RT_USING_MTD_NAND */ -#if defined(RT_USING_MTD_NOR) +#ifdef RT_USING_MTD_NOR sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX); -#endif +#endif /* RT_USING_MTD_NOR */ #endif /* RT_USING_DFS */ diff --git a/components/net/at/Kconfig b/components/net/at/Kconfig index a1bc7ce0663b2e9b5dd390212efa4873442c2eee..59a367df4b78e9ebc6554b3eeeeb5b7692f886b2 100644 --- a/components/net/at/Kconfig +++ b/components/net/at/Kconfig @@ -57,6 +57,7 @@ if RT_USING_AT config AT_USING_SOCKET bool "Enable BSD Socket API support by AT commnads" select RT_USING_SAL + select SAL_USING_AT default n endif diff --git a/components/net/lwip/Kconfig b/components/net/lwip/Kconfig index 78fba33b917f6a4aa4200e4c4ed678f58ca9b5b1..3ead4c43fddd270c447a73908a5f7f83c0e274d4 100644 --- a/components/net/lwip/Kconfig +++ b/components/net/lwip/Kconfig @@ -2,6 +2,7 @@ menuconfig RT_USING_LWIP bool "LwIP: light weight TCP/IP stack" select RT_USING_DEVICE select RT_USING_DEVICE_IPC + select SAL_USING_LWIP if RT_USING_SAL default n if RT_USING_LWIP diff --git a/components/net/sal/Kconfig b/components/net/sal/Kconfig index 27a98d48d7bd5b6e7a5f30fda1bd1504399f5226..6e7e44f98f01891bea41c95598c03e38f0d301d4 100644 --- a/components/net/sal/Kconfig +++ b/components/net/sal/Kconfig @@ -13,26 +13,21 @@ if RT_USING_SAL The ability that check internet status is provided by RT-Thread. menu "Docking with protocol stacks" - config SAL_USING_LWIP bool "Docking with lwIP stack" - default y - depends on RT_USING_LWIP + default n config SAL_USING_AT bool "Docking with AT commands stack" - default y - depends on AT_USING_SOCKET + default n config SAL_USING_WINSOCK bool "Docking with Windows socket (winsock)" - default y - depends on BSP_USING_SAL_WINSOCK + default n config SAL_USING_TLS bool "Docking with MbedTLS protocol" - default y - depends on PKG_USING_MBEDTLS + default n endmenu config SAL_USING_POSIX diff --git a/components/net/sal/SConscript b/components/net/sal/SConscript index 25788e0beddc5fce25c2d85370cea61acf28d642..2b8164df6446cf7dcc7ee2ec97bf602ddcca7178 100644 --- a/components/net/sal/SConscript +++ b/components/net/sal/SConscript @@ -5,30 +5,30 @@ from building import * cwd = GetCurrentDir() src = Glob('src/*.c') -src += Glob('socket/net_netdb.c') +src += ['socket/net_netdb.c'] CPPPATH = [cwd + '/include'] CPPPATH += [cwd + '/include/socket'] +if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'): + CPPPATH += [cwd + '/docking'] + if GetDepend('SAL_USING_LWIP'): - src += Glob('docking/af_inet_lwip.c') + src += ['docking/af_inet_lwip.c'] if GetDepend('SAL_USING_AT'): - src += Glob('docking/af_inet_at.c') - -if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'): - CPPPATH += [cwd + '/docking'] + src += ['docking/af_inet_at.c'] if GetDepend('SAL_USING_WINSOCK'): - src += Glob('docking/af_inet_winsock.c') + src += ['docking/af_inet_winsock.c'] if GetDepend('SAL_USING_TLS'): - src += Glob('docking/proto_mbedtls.c') + src += ['docking/proto_mbedtls.c'] if GetDepend('SAL_USING_POSIX'): CPPPATH += [cwd + '/include/dfs_net'] - src += Glob('socket/net_sockets.c') - src += Glob('dfs_net/*.c') + src += ['socket/net_sockets.c'] + src += ['dfs_net/*.c'] if not GetDepend('HAVE_SYS_SOCKET_H'): CPPPATH += [cwd + '/include/socket/sys_socket']