diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvoptx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvoptx index e7024424..07c4baab 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvoptx +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvoptx @@ -443,7 +443,7 @@ examples - 0 + 1 0 0 0 diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvprojx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvprojx index 0dd9dba5..d4c86d18 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvprojx +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/tcp_through_module/TencentOS_tiny.uvprojx @@ -10,14 +10,14 @@ TencentOS_tiny 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC + 5060750::V5.06 update 6 (build 750)::.\ARMCC 0 STM32L431RCTx STMicroelectronics - Keil.STM32L4xx_DFP.2.0.0 - http://www.keil.com/pack + Keil.STM32L4xx_DFP.2.4.0 + http://www.keil.com/pack/ IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") @@ -185,6 +185,7 @@ 0 2 0 + 0 0 0 8 @@ -336,9 +337,9 @@ 0 - USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266 + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER - ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\net\sal_module_wrapper + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\devices\ec20 @@ -351,7 +352,7 @@ 0 0 0 - 0 + 4 @@ -839,4 +840,19 @@ + + + + <Project Info> + + + + + + 0 + 1 + + + + diff --git a/examples/tcp_through_module/tcp_through_module.c b/examples/tcp_through_module/tcp_through_module.c index 646cfcd0..7d15a127 100644 --- a/examples/tcp_through_module/tcp_through_module.c +++ b/examples/tcp_through_module/tcp_through_module.c @@ -2,18 +2,27 @@ #include "sal_module_wrapper.h" #include "cmsis_os.h" -//#define USE_ESP8266 -#define USE_SIM800A -#define USE_BC26 +#define USE_ESP8266 +//#define USE_SIM800A +//#define USE_BC26 +//#define USE_EC20 -#if defined(USE_ESP8266) +#ifdef USE_ESP8266 #include "esp8266.h" -#elif defined(USE_SIM800A) +#endif + +#ifdef USE_SIM800A #include "sim800a.h" -#elif defined(USE_BC26) +#endif + +#ifdef USE_BC26 #include "bc26.h" #endif +#ifdef USE_EC20 +#include "ec20.h" +#endif + #define TCP_TEST_TASK0_STK_SIZE 4096 void tcp_test0(void); osThreadDef(tcp_test0, osPriorityNormal, 1, TCP_TEST_TASK0_STK_SIZE); @@ -74,21 +83,19 @@ void tcp_test1(void) void application_entry(void *arg) { -#ifdef USE_ESP8266 +#if defined(USE_ESP8266) esp8266_sal_init(HAL_UART_PORT_0); esp8266_join_ap("SheldonDai", "srnr6x9xbhmb0"); -#endif - -#ifdef USE_SIM800A +#elif defined(USE_SIM800A) sim800a_power_on(); sim800a_sal_init(HAL_UART_PORT_2); +#elif defined(USE_BC26) + bc26_sal_init(HAL_UART_PORT_2); +#elif defined(USE_EC20) + ec20_sal_deinit(HAL_PORT_0); #endif -#ifdef USE_BC26 - bc26_sal_init(HAL_UART_PORT_2); -#endif - - socket_id_0 = tos_sal_module_connect("117.50.111.72", "8080", TOS_SAL_PROTO_TCP); + socket_id_0 = tos_sal_module_connect("117.50.111.72", "8080", TOS_SAL_PROTO_TCP); if (socket_id_0 == -1) { printf("TCP0 connect failed\r\n"); } else {