add support for multi at device
This commit is contained in:
@@ -66,7 +66,7 @@ extern UART_HandleTypeDef hlpuart1;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -299,7 +299,7 @@ void LPUART1_IRQHandler(void)
|
||||
__HAL_UART_CLEAR_IDLEFLAG(&hlpuart1);
|
||||
|
||||
if (uart_frame_buffer_index != 0) {
|
||||
tos_at_uart_input_frame(uart_frame_buffer, uart_frame_buffer_index);
|
||||
tos_at_uart_input_frame(&esp8266_agent, uart_frame_buffer, uart_frame_buffer_index);
|
||||
uart_frame_buffer_index = 0;
|
||||
memset(uart_frame_buffer, 0, sizeof(uart_frame_buffer));
|
||||
}
|
||||
@@ -314,14 +314,15 @@ void LPUART1_IRQHandler(void)
|
||||
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
{
|
||||
extern uint8_t data;
|
||||
|
||||
if (huart->Instance == LPUART1) {
|
||||
HAL_UART_Receive_IT(&hlpuart1, &data, 1);
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
uart_frame_buffer[uart_frame_buffer_index++] = data;
|
||||
#elif AT_INPUT_SIMULATE_IDLE_EN
|
||||
tos_at_uart_input_byte_no_notify(data);
|
||||
tos_at_uart_input_byte_no_notify(&esp8266_agent, data);
|
||||
#else
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, data);
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1079,7 +1079,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -339,7 +339,7 @@
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\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\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\kernel\hal\include;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\include;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\include;..\..\..\..\examples\tencent_os_mqtt;..\..\..\..\components\connectivity\mqttclient\common;..\..\..\..\components\connectivity\mqttclient\common\log;..\..\..\..\components\connectivity\mqttclient\mqtt;..\..\..\..\components\connectivity\mqttclient\mqttclient;..\..\..\..\components\connectivity\mqttclient\network;..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny;..\..\..\..\components\utils\JSON\include</IncludePath>
|
||||
<IncludePath>..\..\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\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\..\..\devices\esp8266;..\..\..\..\net\at\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\kernel\hal\include;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\include;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\include;..\..\..\..\examples\tencent_os_mqtt;..\..\..\..\components\connectivity\mqttclient\common;..\..\..\..\components\connectivity\mqttclient\common\log;..\..\..\..\components\connectivity\mqttclient\mqtt;..\..\..\..\components\connectivity\mqttclient\mqttclient;..\..\..\..\components\connectivity\mqttclient\network;..\..\..\..\components\connectivity\mqttclient\platform\TencentOS-tiny;..\..\..\..\components\utils\JSON\include;..\..\..\..\devices\ec20_200_600</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -1028,12 +1028,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -311,7 +311,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1187,7 +1187,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1207,7 +1207,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1239,7 +1239,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -829,11 +829,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName>BearPi_STM32L31RC</LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -1019,11 +1019,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -311,7 +311,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -795,7 +795,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>kernel</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1223,7 +1223,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1243,7 +1243,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1275,7 +1275,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -844,11 +844,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -0,0 +1,307 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32l4xx_it.c
|
||||
* @brief Interrupt Service Routines.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "stm32l4xx_it.h"
|
||||
#include "tos_k.h"
|
||||
#include "tos_at.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN TD */
|
||||
|
||||
/* USER CODE END TD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern UART_HandleTypeDef hlpuart1;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
/* USER CODE BEGIN EV */
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||
|
||||
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Prefetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END BusFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END UsageFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 0 */
|
||||
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
__weak void PendSV_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 0 */
|
||||
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
if (tos_knl_is_running())
|
||||
{
|
||||
tos_knl_irq_enter();
|
||||
tos_tick_handler();
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
//HAL_SYSTICK_IRQHandler();
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32L4xx Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
/* For the available peripheral interrupt handler names, */
|
||||
/* please refer to the startup file (startup_stm32l4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line1 interrupt.
|
||||
*/
|
||||
void EXTI1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI1_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI1_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1);
|
||||
/* USER CODE BEGIN EXTI1_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI1_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line2 interrupt.
|
||||
*/
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI2_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI2_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_2);
|
||||
/* USER CODE BEGIN EXTI2_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line3 interrupt.
|
||||
*/
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI3_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);
|
||||
/* USER CODE BEGIN EXTI3_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART2 global interrupt.
|
||||
*/
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART2_IRQn 0 */
|
||||
|
||||
/* USER CODE END USART2_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart2);
|
||||
/* USER CODE BEGIN USART2_IRQn 1 */
|
||||
|
||||
/* USER CODE END USART2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART3 global interrupt.
|
||||
*/
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART3_IRQn 0 */
|
||||
|
||||
/* USER CODE END USART3_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart3);
|
||||
/* USER CODE BEGIN USART3_IRQn 1 */
|
||||
|
||||
/* USER CODE END USART3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles LPUART1 global interrupt.
|
||||
*/
|
||||
void LPUART1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN LPUART1_IRQn 0 */
|
||||
|
||||
/* USER CODE END LPUART1_IRQn 0 */
|
||||
tos_knl_irq_enter();
|
||||
HAL_UART_IRQHandler(&hlpuart1);
|
||||
tos_knl_irq_leave();
|
||||
/* USER CODE BEGIN LPUART1_IRQn 1 */
|
||||
|
||||
/* USER CODE END LPUART1_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
{
|
||||
extern uint8_t data;
|
||||
if (huart->Instance == LPUART1) {
|
||||
HAL_UART_Receive_IT(&hlpuart1, &data, 1);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -389,8 +389,8 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\BSP\Src\stm32l4xx_it_module.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32l4xx_it_module.c</FilenameWithoutPath>
|
||||
<PathWithFileName>..\..\BSP\Src\tim.c</PathWithFileName>
|
||||
<FilenameWithoutPath>tim.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
@@ -401,8 +401,8 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\BSP\Src\tim.c</PathWithFileName>
|
||||
<FilenameWithoutPath>tim.c</FilenameWithoutPath>
|
||||
<PathWithFileName>.\demo\stm32l4xx_it_tf_module.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32l4xx_it_tf_module.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
@@ -410,7 +410,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -438,16 +438,16 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\spi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_it_module.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\stm32l4xx_it_module.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\tim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_it_tf_module.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\demo\stm32l4xx_it_tf_module.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -843,12 +843,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -0,0 +1,307 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32l4xx_it.c
|
||||
* @brief Interrupt Service Routines.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "stm32l4xx_it.h"
|
||||
#include "tos_k.h"
|
||||
#include "tos_at.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN TD */
|
||||
|
||||
/* USER CODE END TD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern UART_HandleTypeDef hlpuart1;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
/* USER CODE BEGIN EV */
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||
|
||||
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Prefetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END BusFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END UsageFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 0 */
|
||||
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
__weak void PendSV_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 0 */
|
||||
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
if (tos_knl_is_running())
|
||||
{
|
||||
tos_knl_irq_enter();
|
||||
tos_tick_handler();
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
//HAL_SYSTICK_IRQHandler();
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32L4xx Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
/* For the available peripheral interrupt handler names, */
|
||||
/* please refer to the startup file (startup_stm32l4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line1 interrupt.
|
||||
*/
|
||||
void EXTI1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI1_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI1_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1);
|
||||
/* USER CODE BEGIN EXTI1_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI1_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line2 interrupt.
|
||||
*/
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI2_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI2_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_2);
|
||||
/* USER CODE BEGIN EXTI2_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles EXTI line3 interrupt.
|
||||
*/
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN EXTI3_IRQn 0 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 0 */
|
||||
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);
|
||||
/* USER CODE BEGIN EXTI3_IRQn 1 */
|
||||
|
||||
/* USER CODE END EXTI3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART2 global interrupt.
|
||||
*/
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART2_IRQn 0 */
|
||||
|
||||
/* USER CODE END USART2_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart2);
|
||||
/* USER CODE BEGIN USART2_IRQn 1 */
|
||||
|
||||
/* USER CODE END USART2_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USART3 global interrupt.
|
||||
*/
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART3_IRQn 0 */
|
||||
|
||||
/* USER CODE END USART3_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart3);
|
||||
/* USER CODE BEGIN USART3_IRQn 1 */
|
||||
|
||||
/* USER CODE END USART3_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles LPUART1 global interrupt.
|
||||
*/
|
||||
void LPUART1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN LPUART1_IRQn 0 */
|
||||
|
||||
/* USER CODE END LPUART1_IRQn 0 */
|
||||
tos_knl_irq_enter();
|
||||
HAL_UART_IRQHandler(&hlpuart1);
|
||||
tos_knl_irq_leave();
|
||||
/* USER CODE BEGIN LPUART1_IRQn 1 */
|
||||
|
||||
/* USER CODE END LPUART1_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
{
|
||||
extern uint8_t data;
|
||||
if (huart->Instance == LPUART1) {
|
||||
HAL_UART_Receive_IT(&hlpuart1, &data, 1);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -410,7 +410,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1225,18 +1225,6 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\bc35_28_95\bc35_28_95.c</PathWithFileName>
|
||||
<FilenameWithoutPath>bc35_28_95.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\esp8266\esp8266.c</PathWithFileName>
|
||||
<FilenameWithoutPath>esp8266.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1244,7 +1232,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1264,7 +1252,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>13</GroupNumber>
|
||||
<FileNumber>77</FileNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1284,7 +1272,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>14</GroupNumber>
|
||||
<FileNumber>78</FileNumber>
|
||||
<FileNumber>77</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1304,7 +1292,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>79</FileNumber>
|
||||
<FileNumber>78</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1316,7 +1304,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>80</FileNumber>
|
||||
<FileNumber>79</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1328,7 +1316,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>81</FileNumber>
|
||||
<FileNumber>80</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1340,7 +1328,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>82</FileNumber>
|
||||
<FileNumber>81</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1352,7 +1340,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>83</FileNumber>
|
||||
<FileNumber>82</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1364,7 +1352,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>84</FileNumber>
|
||||
<FileNumber>83</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1376,7 +1364,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>85</FileNumber>
|
||||
<FileNumber>84</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1388,7 +1376,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>86</FileNumber>
|
||||
<FileNumber>85</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1400,7 +1388,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>87</FileNumber>
|
||||
<FileNumber>86</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1412,7 +1400,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>88</FileNumber>
|
||||
<FileNumber>87</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1432,7 +1420,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>16</GroupNumber>
|
||||
<FileNumber>89</FileNumber>
|
||||
<FileNumber>88</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1444,7 +1432,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>16</GroupNumber>
|
||||
<FileNumber>90</FileNumber>
|
||||
<FileNumber>89</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1456,7 +1444,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>16</GroupNumber>
|
||||
<FileNumber>91</FileNumber>
|
||||
<FileNumber>90</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1468,7 +1456,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>16</GroupNumber>
|
||||
<FileNumber>92</FileNumber>
|
||||
<FileNumber>91</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1480,7 +1468,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>16</GroupNumber>
|
||||
<FileNumber>93</FileNumber>
|
||||
<FileNumber>92</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1500,7 +1488,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>17</GroupNumber>
|
||||
<FileNumber>94</FileNumber>
|
||||
<FileNumber>93</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1512,7 +1500,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>17</GroupNumber>
|
||||
<FileNumber>95</FileNumber>
|
||||
<FileNumber>94</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1524,7 +1512,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>17</GroupNumber>
|
||||
<FileNumber>96</FileNumber>
|
||||
<FileNumber>95</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1536,7 +1524,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>17</GroupNumber>
|
||||
<FileNumber>97</FileNumber>
|
||||
<FileNumber>96</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1556,7 +1544,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>18</GroupNumber>
|
||||
<FileNumber>98</FileNumber>
|
||||
<FileNumber>97</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1568,7 +1556,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>18</GroupNumber>
|
||||
<FileNumber>99</FileNumber>
|
||||
<FileNumber>98</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1580,7 +1568,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>18</GroupNumber>
|
||||
<FileNumber>100</FileNumber>
|
||||
<FileNumber>99</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1600,7 +1588,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>19</GroupNumber>
|
||||
<FileNumber>101</FileNumber>
|
||||
<FileNumber>100</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1612,7 +1600,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>19</GroupNumber>
|
||||
<FileNumber>102</FileNumber>
|
||||
<FileNumber>101</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1624,7 +1612,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>19</GroupNumber>
|
||||
<FileNumber>103</FileNumber>
|
||||
<FileNumber>102</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1636,7 +1624,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>19</GroupNumber>
|
||||
<FileNumber>104</FileNumber>
|
||||
<FileNumber>103</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1648,7 +1636,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>19</GroupNumber>
|
||||
<FileNumber>105</FileNumber>
|
||||
<FileNumber>104</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1668,7 +1656,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>20</GroupNumber>
|
||||
<FileNumber>106</FileNumber>
|
||||
<FileNumber>105</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1688,7 +1676,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>21</GroupNumber>
|
||||
<FileNumber>107</FileNumber>
|
||||
<FileNumber>106</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -803,11 +803,6 @@
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>bc35_28_95.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\bc35_28_95\bc35_28_95.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>esp8266.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -1043,12 +1038,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -965,7 +965,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>6140000::V6.14::ARMCLANG</pCCUsed>
|
||||
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32WLE5JCIx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32WLxx_DFP.1.0.7</PackID>
|
||||
<PackURL>http://www.keil.com/pack</PackURL>
|
||||
<PackID>Keil.STM32WLxx_DFP.1.1.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x10000) IROM(0x08000000,0x40000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -729,11 +729,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart1;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef hlpuart1;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -254,7 +254,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
|
||||
if (huart->Instance == LPUART1) {
|
||||
HAL_UART_Receive_IT(&hlpuart1, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
@@ -256,7 +256,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1116,7 +1116,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Hardware</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1156,7 +1156,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1188,7 +1188,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1208,7 +1208,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -413,7 +413,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>source</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#include "mcu_init.h"
|
||||
#include "tos_at.h"
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
extern at_agent_t ec600s_agent;
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* Init board hardware. */
|
||||
@@ -21,7 +24,8 @@ void SysTick_Handler(void)
|
||||
}
|
||||
|
||||
/* LPUART2_IRQn interrupt handler */
|
||||
void LPUART2_IRQHandler(void) {
|
||||
void LPUART2_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -30,14 +34,15 @@ void LPUART2_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART2))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART2);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
|
||||
/* LPUART4_IRQn interrupt handler */
|
||||
void LPUART4_IRQHandler(void) {
|
||||
void LPUART4_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -46,7 +51,7 @@ void LPUART4_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART4))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART4);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&ec600s_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
|
@@ -1231,7 +1231,7 @@
|
||||
<TargetName>TencentOS-Tiny flexspi_nor_release</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>6140000::V6.14::ARMCLANG</pCCUsed>
|
||||
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
@@ -2460,11 +2460,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName>TencentOS-Tiny</LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#include "mcu_init.h"
|
||||
#include "tos_at.h"
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
extern at_agent_t ec600s_agent;
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* Init board hardware. */
|
||||
@@ -21,7 +24,8 @@ void SysTick_Handler(void)
|
||||
}
|
||||
|
||||
/* LPUART2_IRQn interrupt handler */
|
||||
void LPUART2_IRQHandler(void) {
|
||||
void LPUART2_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -30,14 +34,15 @@ void LPUART2_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART2))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART2);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
|
||||
/* LPUART4_IRQn interrupt handler */
|
||||
void LPUART4_IRQHandler(void) {
|
||||
void LPUART4_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -46,7 +51,7 @@ void LPUART4_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART4))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART4);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&ec600s_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
|
@@ -413,7 +413,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>source</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1869,7 +1869,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>config</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1889,7 +1889,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal/uart</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1909,7 +1909,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>net/at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1929,7 +1929,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>net/sal_module_wrapper</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1949,7 +1949,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#include "mcu_init.h"
|
||||
#include "tos_at.h"
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
extern at_agent_t ec600s_agent;
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* Init board hardware. */
|
||||
@@ -21,7 +24,8 @@ void SysTick_Handler(void)
|
||||
}
|
||||
|
||||
/* LPUART2_IRQn interrupt handler */
|
||||
void LPUART2_IRQHandler(void) {
|
||||
void LPUART2_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -30,14 +34,15 @@ void LPUART2_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART2))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART2);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
}
|
||||
|
||||
/* LPUART4_IRQn interrupt handler */
|
||||
void LPUART4_IRQHandler(void) {
|
||||
void LPUART4_IRQHandler(void)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
tos_knl_irq_enter();
|
||||
@@ -46,7 +51,7 @@ void LPUART4_IRQHandler(void) {
|
||||
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(LPUART4))
|
||||
{
|
||||
data = LPUART_ReadByte(LPUART4);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&ec600s_agent, data);
|
||||
}
|
||||
|
||||
tos_knl_irq_leave();
|
||||
|
@@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
extern UART_HandleTypeDef huart4;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -201,7 +201,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
|
||||
if (huart->Instance == USART2) {
|
||||
HAL_UART_Receive_IT(&huart2, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -764,11 +764,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1027,7 +1027,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1099,7 +1099,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -803,12 +803,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny_EVB_G0</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -1027,7 +1027,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -839,11 +839,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
extern UART_HandleTypeDef huart4;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -203,7 +203,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
|
||||
if (huart->Instance == USART2) {
|
||||
HAL_UART_Receive_IT(&huart2, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
} else if (huart->Instance == USART3) {
|
||||
//HAL_UART_Receive_IT(&huart3, &ch20_msg, 1);
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1007,7 +1007,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>tos/config</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1047,7 +1047,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1067,7 +1067,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1099,7 +1099,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1119,7 +1119,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hardware</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -819,11 +819,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
extern UART_HandleTypeDef huart4;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -203,7 +203,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
|
||||
if (huart->Instance == USART2) {
|
||||
HAL_UART_Receive_IT(&huart2, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
} else if (huart->Instance == USART3) {
|
||||
HAL_UART_Receive_IT(&huart3, &ch20_msg, 1);
|
||||
ch20_parser_input_byte(ch20_msg);
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -819,11 +819,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
extern UART_HandleTypeDef huart4;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_tf_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -205,7 +205,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
|
||||
if (huart->Instance == USART2) {
|
||||
HAL_UART_Receive_IT(&huart2, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_tf_agent, data);
|
||||
} else if (huart->Instance == USART3) {
|
||||
HAL_UART_Receive_IT(&huart3, &pm2d5_byte_data, 1);
|
||||
pm2d5_parser_input_byte(pm2d5_byte_data);
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1007,7 +1007,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>tos/config</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1047,7 +1047,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>hal</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1067,7 +1067,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>at</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1099,7 +1099,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,14 +10,14 @@
|
||||
<TargetName>TencentOS_Tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32G070RBTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
|
||||
<PackURL>https://www.keil.com/pack/</PackURL>
|
||||
<PackID>Keil.STM32G0xx_DFP.1.4.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x20008FFF) IROM(0x8000000-0x801FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
@@ -804,11 +804,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -62,7 +62,7 @@ extern UART_HandleTypeDef hlpuart1;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart3;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -300,7 +300,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
extern uint8_t data;
|
||||
if (huart->Instance == LPUART1) {
|
||||
HAL_UART_Receive_IT(&hlpuart1, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1206,30 +1206,6 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\air724\air724.c</PathWithFileName>
|
||||
<FilenameWithoutPath>air724.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\ec20_200_600\ec600s.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ec600s.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
@@ -1240,7 +1216,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>13</GroupNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1260,7 +1236,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>14</GroupNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -798,16 +798,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\esp8266\esp8266.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>air724.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\air724\air724.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ec600s.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\ec20_200_600\ec600s.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -853,12 +843,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -467,7 +467,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -794,11 +794,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1283,7 +1283,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>ota_download</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -924,11 +924,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -302,18 +302,6 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\BSP\Src\stm32l4xx_it_module.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32l4xx_it_module.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\BSP\Src\usart.c</PathWithFileName>
|
||||
<FilenameWithoutPath>usart.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -321,7 +309,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -333,7 +321,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>9</FileNumber>
|
||||
<FileNumber>8</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -345,7 +333,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>10</FileNumber>
|
||||
<FileNumber>9</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -357,7 +345,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>11</FileNumber>
|
||||
<FileNumber>10</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -369,7 +357,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>12</FileNumber>
|
||||
<FileNumber>11</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -379,6 +367,18 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>12</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\BSP\Src\stm32l4xx_it_tf_module.c</PathWithFileName>
|
||||
<FilenameWithoutPath>stm32l4xx_it_tf_module.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
@@ -1223,7 +1223,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1243,7 +1243,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>sal_module_wrapper</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1283,7 +1283,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>ota_common</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -413,11 +413,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\BSP\Src\stm32l4xx_hal_msp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_it_module.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\BSP\Src\stm32l4xx_it_module.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>usart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -448,6 +443,11 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\BSP\Src\tim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_it_tf_module.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\BSP\Src\stm32l4xx_it_tf_module.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -908,12 +908,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1213,18 +1213,6 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\air724\air724.c</PathWithFileName>
|
||||
<FilenameWithoutPath>air724.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\ec20_200_600\ec600s.c</PathWithFileName>
|
||||
<FilenameWithoutPath>ec600s.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1240,7 +1228,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>13</GroupNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1260,7 +1248,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>14</GroupNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -798,11 +798,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\esp8266\esp8266.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>air724.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\air724\air724.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>ec600s.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -853,12 +848,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1160,7 +1160,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1171,18 +1171,6 @@
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\air724\air724.c</PathWithFileName>
|
||||
<FilenameWithoutPath>air724.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\esp8266\esp8266.c</PathWithFileName>
|
||||
<FilenameWithoutPath>esp8266.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1192,13 +1180,13 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>sal_module_wrapper</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>13</GroupNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1218,7 +1206,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>14</GroupNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1232,13 +1220,13 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>socket_wrapper</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1250,7 +1238,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>77</FileNumber>
|
||||
<FileNumber>76</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1262,7 +1250,7 @@
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>15</GroupNumber>
|
||||
<FileNumber>78</FileNumber>
|
||||
<FileNumber>77</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -793,11 +793,6 @@
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>air724.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\air724\air724.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>esp8266.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
@@ -868,12 +863,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -874,11 +874,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
@@ -1223,7 +1223,7 @@
|
||||
|
||||
<Group>
|
||||
<GroupName>devices</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
@@ -1239,18 +1239,6 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>12</GroupNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\..\..\..\devices\air724\air724.c</PathWithFileName>
|
||||
<FilenameWithoutPath>air724.c</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
@@ -1261,7 +1249,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>13</GroupNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileNumber>73</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
@@ -1281,7 +1269,7 @@
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>14</GroupNumber>
|
||||
<FileNumber>75</FileNumber>
|
||||
<FileNumber>74</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.4.0</PackID>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.6.1</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -798,11 +798,6 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\esp8266\esp8266.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>air724.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\devices\air724\air724.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -848,12 +843,7 @@
|
||||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>TencentOS_tiny</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -64,7 +64,8 @@ extern UART_HandleTypeDef huart5;
|
||||
extern UART_HandleTypeDef huart2;
|
||||
extern UART_HandleTypeDef huart6;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
extern at_agent_t esp8266_agent;
|
||||
extern at_agent_t ec600s_agent;
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -290,11 +291,11 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
|
||||
extern uint8_t esp_data;
|
||||
if (huart->Instance == USART6) {
|
||||
HAL_UART_Receive_IT(&huart6, &data, 1);
|
||||
tos_at_uart_input_byte(data);
|
||||
tos_at_uart_input_byte(&ec600s_agent, data);
|
||||
}
|
||||
if (huart->Instance == USART2) {
|
||||
HAL_UART_Receive_IT(&huart2, &esp_data, 1);
|
||||
tos_at_uart_input_byte(esp_data);
|
||||
tos_at_uart_input_byte(&esp8266_agent, esp_data);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 1 */
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
|
@@ -10,13 +10,13 @@
|
||||
<TargetName>TencentOS_tiny_STM32H750</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32H750XBHx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32H7xx_DFP.2.7.0</PackID>
|
||||
<PackID>Keil.STM32H7xx_DFP.3.0.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack/</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2001FFFF) IRAM2(0x24000000-0x2407FFFF) IROM(0x8000000-0x801FFFF) CLOCK(12000000) FPU3(DFPU) CPUTYPE("Cortex-M7") ELITTLE TZ</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -1169,11 +1169,6 @@
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
@@ -31,8 +31,12 @@ typedef struct ip_addr_st {
|
||||
uint8_t seg4;
|
||||
}ip_addr_t;
|
||||
|
||||
at_agent_t ec600s_agent;
|
||||
static ip_addr_t domain_parser_addr = {0};
|
||||
static k_sem_t domain_parser_sem;
|
||||
static k_stack_t ec600s_at_parse_task_stk[AT_PARSER_TASK_STACK_SIZE];
|
||||
|
||||
#define AT_AGENT ((at_agent_t *)&ec600s_agent)
|
||||
|
||||
static int ec600s_check_ready(void)
|
||||
{
|
||||
@@ -41,7 +45,7 @@ static int ec600s_check_ready(void)
|
||||
|
||||
while (try++ < 10) {
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "AT\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -58,7 +62,7 @@ static int ec600s_echo_close(void)
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "ATE0\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "ATE0\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -74,7 +78,7 @@ static int ec600s_sim_card_check(void)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CPIN?\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CPIN?\r\n");
|
||||
if (strstr(echo_buffer, "READY")) {
|
||||
return 0;
|
||||
}
|
||||
@@ -93,7 +97,7 @@ static int ec600s_signal_quality_check(void)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CSQ\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CSQ\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -121,7 +125,7 @@ static int ec600s_gsm_network_check(void)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CREG?\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CREG?\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -149,8 +153,7 @@ static int ec600s_gprs_network_check(void)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
while (try++ < 10) {
|
||||
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CGREG?\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CGREG?\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -174,7 +177,7 @@ static int ec600s_close_apn(void)
|
||||
at_echo_t echo;
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 3000, "AT+QIDEACT=1\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 3000, "AT+QIDEACT=1\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -187,12 +190,12 @@ static int ec600s_set_apn(void)
|
||||
at_echo_t echo;
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+QICSGP=1,1,\"CMNET\"\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+QICSGP=1,1,\"CMNET\"\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_cmd_exec(&echo, 3000, "AT+QIACT=1\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 3000, "AT+QIACT=1\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -258,7 +261,7 @@ static int ec600s_connect_establish(int id, sal_proto_t proto)
|
||||
char *remote_port = NULL;
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+QISTATE=1,%d\r\n", id);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+QISTATE=1,%d\r\n", id);
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
printf("query socket %d state fail\r\n", id);
|
||||
return -1;
|
||||
@@ -269,20 +272,20 @@ static int ec600s_connect_establish(int id, sal_proto_t proto)
|
||||
if (query_result_str) {
|
||||
printf("socket %d established on module already\r\n", id);
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+QICLOSE=%d\r\n", id);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+QICLOSE=%d\r\n", id);
|
||||
}
|
||||
|
||||
memset(except_str, 0, sizeof(except_str));
|
||||
sprintf(except_str, "+QIOPEN: %d,0", id);
|
||||
|
||||
remote_ip = (char*)tos_at_channel_ip_get(id);
|
||||
remote_port = (char*)tos_at_channel_port_get(id);
|
||||
remote_ip = (char*)tos_at_channel_ip_get(AT_AGENT, id);
|
||||
remote_port = (char*)tos_at_channel_port_get(AT_AGENT, id);
|
||||
if (!remote_ip || !remote_port) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, except_str);
|
||||
tos_at_cmd_exec_until(&echo, 4000, "AT+QIOPEN=1,%d,\"%s\",\"%s\",%d,0,1\r\n",
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 4000, "AT+QIOPEN=1,%d,\"%s\",\"%s\",%d,0,1\r\n",
|
||||
id, proto == TOS_SAL_PROTO_UDP ? "UDP" : "TCP", remote_ip, atoi(remote_port));
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
printf("establish socket %d on module fail\r\n", id);
|
||||
@@ -296,14 +299,14 @@ static int ec600s_connect(const char *ip, const char *port, sal_proto_t proto)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = tos_at_channel_alloc(ip, port);
|
||||
id = tos_at_channel_alloc(AT_AGENT, ip, port);
|
||||
if (id == -1) {
|
||||
printf("at channel alloc fail\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ec600s_connect_establish(id, proto) < 0) {
|
||||
tos_at_channel_free(id);
|
||||
tos_at_channel_free(AT_AGENT, id);
|
||||
return -2;
|
||||
}
|
||||
|
||||
@@ -314,14 +317,14 @@ static int ec600s_connect_with_size(const char *ip, const char *port, sal_proto_
|
||||
{
|
||||
int id;
|
||||
|
||||
id = tos_at_channel_alloc_with_size(ip, port, socket_buffer_size);
|
||||
id = tos_at_channel_alloc_with_size(AT_AGENT, ip, port, socket_buffer_size);
|
||||
if (id == -1) {
|
||||
printf("at channel alloc fail\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ec600s_connect_establish(id, proto) < 0) {
|
||||
tos_at_channel_free(id);
|
||||
tos_at_channel_free(AT_AGENT, id);
|
||||
return -2;
|
||||
}
|
||||
|
||||
@@ -330,7 +333,7 @@ static int ec600s_connect_with_size(const char *ip, const char *port, sal_proto_
|
||||
|
||||
static int ec600s_recv_timeout(int id, void *buf, size_t len, uint32_t timeout)
|
||||
{
|
||||
return tos_at_channel_read_timed(id, buf, len, timeout);
|
||||
return tos_at_channel_read_timed(AT_AGENT, id, buf, len, timeout);
|
||||
}
|
||||
|
||||
static int ec600s_recv(int id, void *buf, size_t len)
|
||||
@@ -342,38 +345,38 @@ int ec600s_send(int id, const void *buf, size_t len)
|
||||
{
|
||||
at_echo_t echo;
|
||||
|
||||
if (!tos_at_channel_is_working(id)) {
|
||||
if (!tos_at_channel_is_working(AT_AGENT, id)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tos_at_global_lock_pend() != 0) {
|
||||
if (tos_at_global_lock_pend(AT_AGENT) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, ">");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 1000, "AT+QISEND=%d,%d\r\n", id, len);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000, "AT+QISEND=%d,%d\r\n", id, len);
|
||||
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "SEND OK");
|
||||
tos_at_raw_data_send_until(&echo, 10000, (uint8_t *)buf, len);
|
||||
tos_at_raw_data_send_until(AT_AGENT, &echo, 10000, (uint8_t *)buf, len);
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int ec600s_recvfrom_timeout(int id, void *buf, size_t len, uint32_t timeout)
|
||||
{
|
||||
return tos_at_channel_read_timed(id, buf, len, timeout);
|
||||
return tos_at_channel_read_timed(AT_AGENT, id, buf, len, timeout);
|
||||
}
|
||||
|
||||
int ec600s_recvfrom(int id, void *buf, size_t len)
|
||||
@@ -385,26 +388,26 @@ int ec600s_sendto(int id, char *ip, char *port, const void *buf, size_t len)
|
||||
{
|
||||
at_echo_t echo;
|
||||
|
||||
if (tos_at_global_lock_pend() != 0) {
|
||||
if (tos_at_global_lock_pend(AT_AGENT) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, ">");
|
||||
tos_at_cmd_exec_until(&echo, 1000, "AT+QISEND=%d,%d\r\n", id, len);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000, "AT+QISEND=%d,%d\r\n", id, len);
|
||||
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "SEND OK");
|
||||
tos_at_raw_data_send(&echo, 1000, (uint8_t *)buf, len);
|
||||
tos_at_raw_data_send(AT_AGENT, &echo, 1000, (uint8_t *)buf, len);
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
|
||||
return len;
|
||||
}
|
||||
@@ -414,7 +417,7 @@ static void ec600s_transparent_mode_exit(void)
|
||||
at_echo_t echo;
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 500, "+++");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 500, "+++");
|
||||
}
|
||||
|
||||
static int ec600s_close(int id)
|
||||
@@ -424,9 +427,9 @@ static int ec600s_close(int id)
|
||||
ec600s_transparent_mode_exit();
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+QICLOSE=%d\r\n", id);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+QICLOSE=%d\r\n", id);
|
||||
|
||||
tos_at_channel_free(id);
|
||||
tos_at_channel_free(AT_AGENT, id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -439,7 +442,7 @@ static int ec600s_parse_domain(const char *host_name, char *host_ip, size_t host
|
||||
tos_sem_create_max(&domain_parser_sem, 0, 1);
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
tos_at_cmd_exec(&echo, 2000, "AT+QIDNSGIP=1,\"%s\"\r\n", host_name);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 2000, "AT+QIDNSGIP=1,\"%s\"\r\n", host_name);
|
||||
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
@@ -466,7 +469,7 @@ __STATIC__ void ec600s_incoming_data_process(void)
|
||||
*/
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == ',') {
|
||||
@@ -476,7 +479,7 @@ __STATIC__ void ec600s_incoming_data_process(void)
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -486,7 +489,7 @@ __STATIC__ void ec600s_incoming_data_process(void)
|
||||
data_len = data_len * 10 + (data - '0');
|
||||
}
|
||||
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -495,11 +498,11 @@ __STATIC__ void ec600s_incoming_data_process(void)
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
read_len = MIN(data_len, sizeof(buffer));
|
||||
if (tos_at_uart_read(buffer, read_len) != read_len) {
|
||||
if (tos_at_uart_read(AT_AGENT, buffer, read_len) != read_len) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tos_at_channel_write(channel_id, buffer, read_len) <= 0) {
|
||||
if (tos_at_channel_write(AT_AGENT, channel_id, buffer, read_len) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -519,7 +522,7 @@ __STATIC__ void ec600s_domain_data_process(void)
|
||||
+QIURC: "dnsgip","xxx.xxx.xxx.xxx"
|
||||
*/
|
||||
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -530,7 +533,7 @@ __STATIC__ void ec600s_domain_data_process(void)
|
||||
if (data == '\"') {
|
||||
/* start parser domain */
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == '.') {
|
||||
@@ -539,7 +542,7 @@ __STATIC__ void ec600s_domain_data_process(void)
|
||||
domain_parser_addr.seg1 = domain_parser_addr.seg1 *10 + (data-'0');
|
||||
}
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == '.') {
|
||||
@@ -548,7 +551,7 @@ __STATIC__ void ec600s_domain_data_process(void)
|
||||
domain_parser_addr.seg2 = domain_parser_addr.seg2 *10 + (data-'0');
|
||||
}
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == '.') {
|
||||
@@ -557,7 +560,7 @@ __STATIC__ void ec600s_domain_data_process(void)
|
||||
domain_parser_addr.seg3 = domain_parser_addr.seg3 *10 + (data-'0');
|
||||
}
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == '\"') {
|
||||
@@ -593,7 +596,8 @@ sal_module_t sal_module_ec600s = {
|
||||
int ec600s_sal_init(hal_uart_port_t uart_port)
|
||||
{
|
||||
|
||||
if (tos_at_init(uart_port, ec600s_at_event,
|
||||
if (tos_at_init(AT_AGENT, "ec600s_at", ec600s_at_parse_task_stk,
|
||||
uart_port, ec600s_at_event,
|
||||
sizeof(ec600s_at_event) / sizeof(ec600s_at_event[0])) != 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -618,7 +622,7 @@ int ec600s_sal_deinit()
|
||||
|
||||
tos_sal_module_register_default();
|
||||
|
||||
tos_at_deinit();
|
||||
tos_at_deinit(AT_AGENT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,13 +1,17 @@
|
||||
#include "tos_at.h"
|
||||
#include "esp8266.h"
|
||||
#include "sal_module_wrapper.h"
|
||||
|
||||
#include "stdio.h"
|
||||
#include "stdbool.h"
|
||||
#include "ctype.h"
|
||||
|
||||
#define TOS_CFG_MODULE_SINGLE_LINK_EN 0u
|
||||
|
||||
at_agent_t esp8266_agent;
|
||||
static k_stack_t esp8266_at_parse_task_stk[AT_PARSER_TASK_STACK_SIZE];
|
||||
|
||||
#define AT_AGENT ((at_agent_t *)&esp8266_agent)
|
||||
|
||||
static int esp8266_restore(void)
|
||||
{
|
||||
int try = 0;
|
||||
@@ -15,7 +19,7 @@ static int esp8266_restore(void)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "ready");
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec_until(&echo, 5000, "AT+RESTORE\r\n");
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 5000, "AT+RESTORE\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -28,7 +32,7 @@ static int esp8266_echo_close(void)
|
||||
at_echo_t echo;
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "ATE0\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "ATE0\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -57,7 +61,7 @@ static int esp8266_net_mode_set(esp8266_net_mode_t mode)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, cmd);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, cmd);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -72,7 +76,7 @@ static int esp8266_send_mode_set(esp8266_send_mode_t mode)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CIPMODE=%d\r\n", mode == ESP8266_SEND_MODE_NORMAL ? 0 : 1);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CIPMODE=%d\r\n", mode == ESP8266_SEND_MODE_NORMAL ? 0 : 1);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -87,7 +91,7 @@ static int esp8266_multilink_set(esp8266_multilink_state_t state)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 500, "AT+CIPMUX=%d\r\n", state == ESP8266_MULTILINK_STATE_ENABLE ? 1 : 0);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 500, "AT+CIPMUX=%d\r\n", state == ESP8266_MULTILINK_STATE_ENABLE ? 1 : 0);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
} else if (echo.status == AT_ECHO_STATUS_ERROR) {
|
||||
@@ -104,7 +108,7 @@ int esp8266_join_ap(const char *ssid, const char *pwd)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 15000, "AT+CWJAP=\"%s\",\"%s\"\r\n", ssid, pwd);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 15000, "AT+CWJAP=\"%s\",\"%s\"\r\n", ssid, pwd);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -143,7 +147,7 @@ static int esp8266_connect(const char *ip, const char *port, sal_proto_t proto)
|
||||
int id;
|
||||
at_echo_t echo;
|
||||
|
||||
id = tos_at_channel_alloc(ip, port);
|
||||
id = tos_at_channel_alloc(AT_AGENT, ip, port);
|
||||
if (id == -1) {
|
||||
return -1;
|
||||
}
|
||||
@@ -154,7 +158,7 @@ static int esp8266_connect(const char *ip, const char *port, sal_proto_t proto)
|
||||
"AT+CIPSTART=\"%s\",\"%s\",%s\r\n",
|
||||
proto == TOS_SAL_PROTO_UDP ? "UDP" : "TCP", ip, port);
|
||||
#else
|
||||
tos_at_cmd_exec(&echo, 10000,
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 10000,
|
||||
"AT+CIPSTART=%d,\"%s\",\"%s\",%s\r\n",
|
||||
id, proto == TOS_SAL_PROTO_UDP ? "UDP" : "TCP", ip, port);
|
||||
#endif
|
||||
@@ -162,19 +166,19 @@ static int esp8266_connect(const char *ip, const char *port, sal_proto_t proto)
|
||||
return id;
|
||||
}
|
||||
|
||||
tos_at_channel_free(id);
|
||||
tos_at_channel_free(AT_AGENT, id);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int esp8266_recv_timeout(int id, void *buf, size_t len, uint32_t timeout)
|
||||
{
|
||||
return tos_at_channel_read_timed(id, buf, len, timeout);
|
||||
return tos_at_channel_read_timed(AT_AGENT, id, buf, len, timeout);
|
||||
}
|
||||
|
||||
static int esp8266_recv(int id, void *buf, size_t len)
|
||||
{
|
||||
return tos_at_channel_read(id, buf, len);
|
||||
return tos_at_channel_read(AT_AGENT, id, buf, len);
|
||||
}
|
||||
|
||||
static int esp8266_is_link_broken(const char *echo_buffer)
|
||||
@@ -192,11 +196,11 @@ static int esp8266_send(int id, const void *buf, size_t len)
|
||||
at_echo_t echo;
|
||||
char echo_buffer[64];
|
||||
|
||||
if (!tos_at_channel_is_working(id)) {
|
||||
if (!tos_at_channel_is_working(AT_AGENT, id)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tos_at_global_lock_pend() != 0) {
|
||||
if (tos_at_global_lock_pend(AT_AGENT) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -205,16 +209,16 @@ static int esp8266_send(int id, const void *buf, size_t len)
|
||||
tos_at_cmd_exec_until(&echo, 5000,
|
||||
"AT+CIPSEND=%d\r\n", len);
|
||||
#else
|
||||
tos_at_cmd_exec_until(&echo, 5000,
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 5000,
|
||||
"AT+CIPSEND=%d,%d\r\n",
|
||||
id, len);
|
||||
#endif
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
if (esp8266_is_link_broken((const char *)echo.buffer)) {
|
||||
tos_at_channel_set_broken(id);
|
||||
tos_at_channel_set_broken(AT_AGENT, id);
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -224,17 +228,17 @@ static int esp8266_send(int id, const void *buf, size_t len)
|
||||
ATTENTION: we should wait util "SEND OK" is echoed, otherwise the next
|
||||
time we execute at command, the esp8266 maybe in a "busy s ..." state.
|
||||
*/
|
||||
tos_at_raw_data_send_until(&echo, 10000, (uint8_t *)buf, len);
|
||||
tos_at_raw_data_send_until(AT_AGENT, &echo, 10000, (uint8_t *)buf, len);
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
if (esp8266_is_link_broken((const char *)echo.buffer)) {
|
||||
tos_at_channel_set_broken(id);
|
||||
tos_at_channel_set_broken(AT_AGENT, id);
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -243,11 +247,11 @@ static int esp8266_sendto(int id, char *ip, char *port, const void *buf, size_t
|
||||
at_echo_t echo;
|
||||
char echo_buffer[64];
|
||||
|
||||
if (!tos_at_channel_is_working(id)) {
|
||||
if (!tos_at_channel_is_working(AT_AGENT, id)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tos_at_global_lock_pend() != 0) {
|
||||
if (tos_at_global_lock_pend(AT_AGENT) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -258,7 +262,7 @@ static int esp8266_sendto(int id, char *ip, char *port, const void *buf, size_t
|
||||
tos_at_cmd_exec_until(&echo, 1000,
|
||||
"AT+CIPSEND=%d,\"%s\",%s\r\n", len, ip, port);
|
||||
#else
|
||||
tos_at_cmd_exec_until(&echo, 1000,
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000,
|
||||
"AT+CIPSEND=%d,%d,\"%s\",%s\r\n", id, len, ip, port);
|
||||
#endif
|
||||
} else {
|
||||
@@ -266,17 +270,17 @@ static int esp8266_sendto(int id, char *ip, char *port, const void *buf, size_t
|
||||
tos_at_cmd_exec_until(&echo, 1000,
|
||||
"AT+CIPSEND=%d\r\n", len);
|
||||
#else
|
||||
tos_at_cmd_exec_until(&echo, 1000,
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000,
|
||||
"AT+CIPSEND=%d,%d\r\n", id, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
if (esp8266_is_link_broken((const char *)echo.buffer)) {
|
||||
tos_at_channel_set_broken(id);
|
||||
tos_at_channel_set_broken(AT_AGENT, id);
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -286,23 +290,23 @@ static int esp8266_sendto(int id, char *ip, char *port, const void *buf, size_t
|
||||
ATTENTION: we should wait util "SEND OK" is echoed, otherwise the next
|
||||
time we execute at command, the esp8266 maybe in a "busy s ..." state.
|
||||
*/
|
||||
tos_at_raw_data_send_until(&echo, 10000, (uint8_t *)buf, len);
|
||||
tos_at_raw_data_send_until(AT_AGENT, &echo, 10000, (uint8_t *)buf, len);
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
if (esp8266_is_link_broken((const char *)echo.buffer)) {
|
||||
tos_at_channel_set_broken(id);
|
||||
tos_at_channel_set_broken(AT_AGENT, id);
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_global_lock_post();
|
||||
tos_at_global_lock_post(AT_AGENT);
|
||||
return len;
|
||||
}
|
||||
|
||||
static int esp8266_recvfrom_timeout(int id, void *buf, size_t len, uint32_t timeout)
|
||||
{
|
||||
return tos_at_channel_read_timed(id, buf, len, timeout);
|
||||
return tos_at_channel_read_timed(AT_AGENT, id, buf, len, timeout);
|
||||
}
|
||||
|
||||
static int esp8266_recvfrom(int id, void *buf, size_t len)
|
||||
@@ -317,11 +321,11 @@ static int esp8266_close(int id)
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
#if TOS_CFG_MODULE_SINGLE_LINK_EN > 0u
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CIPCLOSE\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CIPCLOSE\r\n");
|
||||
#else
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CIPCLOSE=%d\r\n", id);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CIPCLOSE=%d\r\n", id);
|
||||
#endif
|
||||
tos_at_channel_free(id);
|
||||
tos_at_channel_free(AT_AGENT, id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -334,7 +338,7 @@ static int esp8266_parse_domain(const char *host_name, char *host_ip, size_t hos
|
||||
esp8266_reconnect_init();
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
tos_at_cmd_exec(&echo, 2000, "AT+CIPDOMAIN=\"%s\"\r\n", host_name);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 2000, "AT+CIPDOMAIN=\"%s\"\r\n", host_name);
|
||||
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
@@ -409,7 +413,7 @@ __STATIC__ void esp8266_incoming_data_process(void)
|
||||
*/
|
||||
#if TOS_CFG_MODULE_SINGLE_LINK_EN == 0u
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == ',') {
|
||||
@@ -420,7 +424,7 @@ __STATIC__ void esp8266_incoming_data_process(void)
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == ':') {
|
||||
@@ -434,14 +438,14 @@ __STATIC__ void esp8266_incoming_data_process(void)
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
read_len = MIN(data_len, sizeof(buffer));
|
||||
if (tos_at_uart_read(buffer, read_len) != read_len) {
|
||||
if (tos_at_uart_read(AT_AGENT, buffer, read_len) != read_len) {
|
||||
return;
|
||||
}
|
||||
|
||||
//delay has two reason, wait for the data to be cached and untrigger scheduling
|
||||
tos_stopwatch_delay(200);
|
||||
|
||||
if (tos_at_channel_write(channel_id, buffer, read_len) <= 0) {
|
||||
if (tos_at_channel_write(AT_AGENT, channel_id, buffer, read_len) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -469,7 +473,8 @@ sal_module_t sal_module_esp8266 = {
|
||||
|
||||
int esp8266_sal_init(hal_uart_port_t uart_port)
|
||||
{
|
||||
if (tos_at_init(uart_port, esp8266_at_event,
|
||||
if (tos_at_init(AT_AGENT, "esp8266_at", esp8266_at_parse_task_stk,
|
||||
uart_port, esp8266_at_event,
|
||||
sizeof(esp8266_at_event) / sizeof(esp8266_at_event[0])) != 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -495,7 +500,7 @@ int esp8266_sal_deinit()
|
||||
|
||||
tos_sal_module_register_default();
|
||||
|
||||
tos_at_deinit();
|
||||
tos_at_deinit(AT_AGENT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -6,6 +6,11 @@
|
||||
#include "tencent_firmware_module_wrapper.h"
|
||||
#include "esp8266_tencent_firmware.h"
|
||||
|
||||
at_agent_t esp8266_tf_agent;
|
||||
static k_stack_t esp8266_tf_at_parse_task_stk[AT_PARSER_TASK_STACK_SIZE];
|
||||
|
||||
#define AT_AGENT ((at_agent_t *)&esp8266_tf_agent)
|
||||
|
||||
/*
|
||||
* config dev info to module, do this operate only once in factroy is suggested
|
||||
*/
|
||||
@@ -15,7 +20,7 @@ int esp8266_tencent_firmware_module_info_set(device_info_t *info, tls_mode_t mod
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCDEVINFOSET:OK");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCDEVINFOSET=%d,\"%s\",\"%s\",\"%s\"\r\n",
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCDEVINFOSET=%d,\"%s\",\"%s\",\"%s\"\r\n",
|
||||
mode, info->product_id, info->device_name, info->device_serc);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
@@ -31,7 +36,7 @@ int esp8266_tencent_firmware_module_mqtt_conn(mqtt_param_t init_params)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCMQTTCONN:OK");
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCMQTTCONN=%d,%d,%d,%d,%d\r\n", init_params.tls_mode,
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCMQTTCONN=%d,%d,%d,%d,%d\r\n", init_params.tls_mode,
|
||||
init_params.command_timeout, init_params.keep_alive_interval_ms,
|
||||
init_params.clean_session, init_params.auto_connect_enable);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
@@ -48,7 +53,7 @@ int esp8266_tencent_firmware_module_mqtt_discon(void)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+TCMQTTDISCONN\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+TCMQTTDISCONN\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -63,13 +68,13 @@ int esp8266_tencent_firmware_module_mqtt_publ(const char *topic, qos_t qos, char
|
||||
|
||||
strcat(payload, "\r\n");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 1000, "AT+TCMQTTPUBL=\"%s\",%d,%d\r\n", topic, qos, strlen(payload)-2);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000, "AT+TCMQTTPUBL=\"%s\",%d,%d\r\n", topic, qos, strlen(payload)-2);
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCMQTTPUBL:OK");
|
||||
tos_at_raw_data_send_until(&echo, 1000, (uint8_t *)payload, strlen(payload));
|
||||
tos_at_raw_data_send_until(AT_AGENT, &echo, 1000, (uint8_t *)payload, strlen(payload));
|
||||
if (echo.status != AT_ECHO_STATUS_EXPECT) {
|
||||
return -1;
|
||||
}
|
||||
@@ -84,7 +89,7 @@ int esp8266_tencent_firmware_module_mqtt_pub(const char *topic, qos_t qos, char
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCMQTTPUB:OK");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 1000, "AT+TCMQTTPUB=\"%s\",%d,\"%s\"\r\n", topic, qos, payload);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 1000, "AT+TCMQTTPUB=\"%s\",%d,\"%s\"\r\n", topic, qos, payload);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -97,7 +102,7 @@ int esp8266_tencent_firmware_module_mqtt_sub(char *topic, qos_t qos)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCMQTTSUB:OK");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCMQTTSUB=\"%s\",%d\r\n", topic, qos);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCMQTTSUB=\"%s\",%d\r\n", topic, qos);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -110,7 +115,7 @@ int esp8266_tencent_firmware_module_mqtt_unsub(const char *topic)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCMQTTUNSUB:OK");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCMQTTUNSUB=\"%s\"\r\n", topic);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCMQTTUNSUB=\"%s\"\r\n", topic);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -126,7 +131,7 @@ int esp8266_tencent_firmware_module_mqtt_state_get(mqtt_state_t *state)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+TCMQTTSTATE?\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+TCMQTTSTATE?\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -153,7 +158,7 @@ int esp8266_tencent_firmware_module_debug_level_set(int log_level)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+TCTEMLOG=%d\r\n", log_level);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+TCTEMLOG=%d\r\n", log_level);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -167,7 +172,7 @@ int esp8266_tencent_firmware_join_ap(const char *ssid, const char *pwd)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 30000, "AT+CWJAP=\"%s\",\"%s\"\r\n", ssid, pwd);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 30000, "AT+CWJAP=\"%s\",\"%s\"\r\n", ssid, pwd);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -183,7 +188,7 @@ static int esp8266_tencent_firmware_restore(void)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "ready");
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec_until(&echo, 5000, "AT+RESTORE\r\n");
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 5000, "AT+RESTORE\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -196,7 +201,7 @@ static int esp8266_tencent_firmware_echo_close(void)
|
||||
at_echo_t echo;
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 1000, "ATE0\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "ATE0\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -225,7 +230,7 @@ static int esp8266_tencent_firmware_net_mode_set(sal_net_mode_t mode)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, cmd);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, cmd);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -240,7 +245,7 @@ static int esp8266_tencent_firmware_send_mode_set(sal_send_mode_t mode)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
while (try++ < 10) {
|
||||
tos_at_cmd_exec(&echo, 1000, "AT+CIPMODE=%d\r\n", mode == SAL_SEND_MODE_NORMAL ? 0 : 1);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 1000, "AT+CIPMODE=%d\r\n", mode == SAL_SEND_MODE_NORMAL ? 0 : 1);
|
||||
if (echo.status == AT_ECHO_STATUS_OK) {
|
||||
return 0;
|
||||
}
|
||||
@@ -283,7 +288,7 @@ int esp8266_tencent_firmware_ota_set(ota_mode_t mode, char *version)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "+TCOTASET:OK");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCOTASET=%d,\"%s\"\r\n", mode, version);
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCOTASET=%d,\"%s\"\r\n", mode, version);
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
return 0;
|
||||
}
|
||||
@@ -306,7 +311,7 @@ int esp8266_tencent_firmware_ota_read_fwinfo(ota_fw_info_t *ota_fw_info)
|
||||
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), "+TCFWINFO:");
|
||||
|
||||
tos_at_cmd_exec_until(&echo, 2000, "AT+TCFWINFO?\r\n");
|
||||
tos_at_cmd_exec_until(AT_AGENT, &echo, 2000, "AT+TCFWINFO?\r\n");
|
||||
if (echo.status == AT_ECHO_STATUS_EXPECT) {
|
||||
|
||||
sscanf(echo_buffer, "%*[^\"]%*c%[^\"]%*[^,]%*c%[^,]%*[^\"]%*c%[^\"]", ota_fw_info->fw_version, FileSize, ota_fw_info->fw_md5);
|
||||
@@ -341,7 +346,7 @@ static int esp8266_tencent_firmware_ota_read_fwdata(uint8_t *ota_fw_data_buffer,
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
tos_at_cmd_exec(&echo, 300, "AT+TCREADFWDATA=%d\r\n", read_len);
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 300, "AT+TCREADFWDATA=%d\r\n", read_len);
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -365,7 +370,7 @@ void esp8266_tencent_firmware_recvpub(void)
|
||||
memset(&mqtt_message, 0, sizeof(mqtt_message));
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == '"') {
|
||||
@@ -384,7 +389,7 @@ void esp8266_tencent_firmware_recvpub(void)
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == ',') {
|
||||
@@ -397,7 +402,7 @@ void esp8266_tencent_firmware_recvpub(void)
|
||||
payload_len = sizeof(mqtt_message.payload);
|
||||
}
|
||||
|
||||
read_len = tos_at_uart_read((uint8_t*)mqtt_message.payload, payload_len + 2);
|
||||
read_len = tos_at_uart_read(AT_AGENT, (uint8_t*)mqtt_message.payload, payload_len + 2);
|
||||
if (read_len != payload_len + 2) {
|
||||
return;
|
||||
}
|
||||
@@ -414,7 +419,7 @@ void esp8266_tencent_firmware_recvcmd(void)
|
||||
uint8_t buffer[20];
|
||||
int read_len = 13;
|
||||
|
||||
if (tos_at_uart_read(buffer, read_len) != read_len) {
|
||||
if (tos_at_uart_read(AT_AGENT, buffer, read_len) != read_len) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -437,7 +442,7 @@ void esp8266_tencent_firmware_recvfwdata(void)
|
||||
static uint8_t buffer[128];
|
||||
|
||||
while (1) {
|
||||
if (tos_at_uart_read(&data, 1) != 1) {
|
||||
if (tos_at_uart_read(AT_AGENT, &data, 1) != 1) {
|
||||
return;
|
||||
}
|
||||
if (data == ',') {
|
||||
@@ -449,7 +454,7 @@ void esp8266_tencent_firmware_recvfwdata(void)
|
||||
do {
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
read_len = MIN(data_len, sizeof(buffer));
|
||||
if (tos_at_uart_read(buffer, read_len) != read_len) {
|
||||
if (tos_at_uart_read(AT_AGENT, buffer, read_len) != read_len) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -481,7 +486,7 @@ int esp8266_tencent_firmware_start_smartconfig(void)
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
tos_at_cmd_exec(&echo, 2000, "AT+TCSTARTSMART\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 2000, "AT+TCSTARTSMART\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -508,7 +513,7 @@ int esp8266_tencent_firmware_stop_smartconfig(void)
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, NULL);
|
||||
|
||||
tos_at_cmd_exec(&echo, 2000, "AT+TCSTOPSMART\r\n");
|
||||
tos_at_cmd_exec(AT_AGENT, &echo, 2000, "AT+TCSTOPSMART\r\n");
|
||||
if (echo.status != AT_ECHO_STATUS_OK) {
|
||||
return -1;
|
||||
}
|
||||
@@ -523,7 +528,7 @@ void esp8266_tencent_firmware_recvscstatus(void)
|
||||
*/
|
||||
static char buffer[40];
|
||||
|
||||
if (tos_at_uart_read((uint8_t*)buffer, sizeof(buffer) - 1) != (sizeof(buffer) - 1)) {
|
||||
if (tos_at_uart_read(AT_AGENT, (uint8_t*)buffer, sizeof(buffer) - 1) != (sizeof(buffer) - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -568,7 +573,8 @@ int esp8266_tencent_firmware_sal_init(hal_uart_port_t uart_port)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
if (tos_at_init(uart_port, esp8266_tencent_firmware_at_event,
|
||||
if (tos_at_init(AT_AGENT, "esp8266_tf_at", esp8266_tf_at_parse_task_stk,
|
||||
uart_port, esp8266_tencent_firmware_at_event,
|
||||
sizeof(esp8266_tencent_firmware_at_event) /
|
||||
sizeof(esp8266_tencent_firmware_at_event[0])) != 0) {
|
||||
return -1;
|
||||
@@ -585,3 +591,9 @@ int esp8266_tencent_firmware_sal_init(hal_uart_port_t uart_port)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int esp8266_tencent_firmware_sal_deinit()
|
||||
{
|
||||
tos_at_deinit(AT_AGENT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ typedef enum sal_send_mode {
|
||||
} sal_send_mode_t;
|
||||
|
||||
int esp8266_tencent_firmware_sal_init(hal_uart_port_t uart_port);
|
||||
int esp8266_tencent_firmware_sal_deinit(void);
|
||||
int esp8266_tencent_firmware_join_ap(const char *ssid, const char *pwd);
|
||||
|
||||
#endif /* __ESP8266_TENCENT_FIRMWARE_H__ */
|
||||
|
@@ -5,13 +5,11 @@
|
||||
#include "sal_module_wrapper.h"
|
||||
|
||||
#define USE_ESP8266
|
||||
|
||||
//#define USE_EC600S
|
||||
|
||||
#if defined(USE_ESP8266)
|
||||
#include "esp8266.h"
|
||||
|
||||
#elif defined(USE_EC200S)
|
||||
#elif defined(USE_EC600S)
|
||||
#include "ec600s.h"
|
||||
#endif
|
||||
|
||||
@@ -101,7 +99,7 @@ void mqttclient_task(void)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_EC200S
|
||||
#ifdef USE_EC600S
|
||||
ec600s_sal_init(HAL_UART_PORT_2);
|
||||
#endif
|
||||
|
||||
|
@@ -165,14 +165,13 @@ typedef struct at_agent_st {
|
||||
uint8_t *uart_rx_fifo_buffer;
|
||||
} at_agent_t;
|
||||
|
||||
#define AT_AGENT ((at_agent_t *)(&at_agent))
|
||||
|
||||
/**
|
||||
* @brief Write data to a channel.
|
||||
* Write data to a channel with certain id.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
* @param[in] buffer data buffer to write.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
@@ -181,7 +180,7 @@ typedef struct at_agent_st {
|
||||
* @retval -1 write failed(error).
|
||||
* @retval none -1 the number of bytes written.
|
||||
*/
|
||||
__API__ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len);
|
||||
__API__ int tos_at_channel_write(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len);
|
||||
|
||||
/**
|
||||
* @brief Read data from a channel.
|
||||
@@ -189,6 +188,7 @@ __API__ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
* @param[out] buffer buffer to hold the data read.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
@@ -198,7 +198,7 @@ __API__ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_
|
||||
* @retval -1 read failed(error).
|
||||
* @retval none -1 the number of bytes read.
|
||||
*/
|
||||
__API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout);
|
||||
__API__ int tos_at_channel_read_timed(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout);
|
||||
|
||||
/**
|
||||
* @brief Read data from a channel.
|
||||
@@ -206,6 +206,7 @@ __API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t bu
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
* @param[out] buffer buffer to hold the data read.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
@@ -214,7 +215,7 @@ __API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t bu
|
||||
* @retval -1 read failed(error).
|
||||
* @retval none -1 the number of bytes read.
|
||||
*/
|
||||
__API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len);
|
||||
__API__ int tos_at_channel_read(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len);
|
||||
|
||||
/**
|
||||
* @brief Allocate a channel.
|
||||
@@ -222,6 +223,7 @@ __API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_l
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
* @param[in] ip remote ip of the channel.
|
||||
* @param[in] port remote port of the channel.
|
||||
@@ -230,7 +232,7 @@ __API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_l
|
||||
* @retval -1 allocate failed(error).
|
||||
* @retval none -1 the id of the channel.
|
||||
*/
|
||||
__API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port);
|
||||
__API__ int tos_at_channel_alloc_id(at_agent_t *at_agent, int channel_id, const char *ip, const char *port);
|
||||
|
||||
/**
|
||||
* @brief Allocate a channel.
|
||||
@@ -238,6 +240,7 @@ __API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] ip remote ip of the channel.
|
||||
* @param[in] port remote port of the channel.
|
||||
*
|
||||
@@ -245,7 +248,7 @@ __API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *
|
||||
* @retval -1 allocate failed(error).
|
||||
* @retval none -1 the id of the channel.
|
||||
*/
|
||||
__API__ int tos_at_channel_alloc(const char *ip, const char *port);
|
||||
__API__ int tos_at_channel_alloc(at_agent_t *at_agent, const char *ip, const char *port);
|
||||
|
||||
/**
|
||||
* @brief Allocate a channel.
|
||||
@@ -253,6 +256,7 @@ __API__ int tos_at_channel_alloc(const char *ip, const char *port);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
* @param[in] ip remote ip of the channel.
|
||||
* @param[in] port remote port of the channel.
|
||||
@@ -262,7 +266,7 @@ __API__ int tos_at_channel_alloc(const char *ip, const char *port);
|
||||
* @retval -1 allocate failed(error).
|
||||
* @retval none -1 the id of the channel.
|
||||
*/
|
||||
__API__ int tos_at_channel_alloc_with_size(const char *ip, const char *port, size_t socket_buffer_size);
|
||||
__API__ int tos_at_channel_alloc_with_size(at_agent_t *at_agent, const char *ip, const char *port, size_t socket_buffer_size);
|
||||
|
||||
/**
|
||||
* @brief Free a channel.
|
||||
@@ -270,43 +274,47 @@ __API__ int tos_at_channel_alloc_with_size(const char *ip, const char *port, siz
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
*
|
||||
* @return errcode
|
||||
* @retval -1 free failed(error).
|
||||
* @retval 0 free successfully.
|
||||
*/
|
||||
__API__ int tos_at_channel_free(int channel_id);
|
||||
__API__ int tos_at_channel_free(at_agent_t *at_agent, int channel_id);
|
||||
|
||||
/**
|
||||
* @brief Set channel broken.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
*
|
||||
* @return errcode
|
||||
* @retval -1 set failed(error).
|
||||
* @retval 0 set successfully.
|
||||
*/
|
||||
__API__ int tos_at_channel_set_broken(int channel_id);
|
||||
__API__ int tos_at_channel_set_broken(at_agent_t *at_agent, int channel_id);
|
||||
|
||||
/**
|
||||
* @brief Judge whether channel is working.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
*
|
||||
* @return at channel status(type of at_channel_status_t)
|
||||
*/
|
||||
__API__ int tos_at_channel_is_working(int channel_id);
|
||||
__API__ int tos_at_channel_is_working(at_agent_t *at_agent, int channel_id);
|
||||
|
||||
/**
|
||||
* @brief Initialize the at framework.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] uart_port port number of the uart thougth which the module connect to the MCU.
|
||||
* @param[in] event_table the listened event table.
|
||||
* @param[in] event_table_size the size of the listened event table.
|
||||
@@ -315,17 +323,19 @@ __API__ int tos_at_channel_is_working(int channel_id);
|
||||
* @retval -1 initialize failed(error).
|
||||
* @retval 0 initialize successfully.
|
||||
*/
|
||||
__API__ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size);
|
||||
__API__ int tos_at_init(at_agent_t *at_agent, char *task_name, k_stack_t *stk, hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size);
|
||||
|
||||
/**
|
||||
* @brief De-initialize the at framework.
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @return
|
||||
None
|
||||
*/
|
||||
__API__ void tos_at_deinit(void);
|
||||
__API__ void tos_at_deinit(at_agent_t *at_agent);
|
||||
|
||||
/**
|
||||
* @brief Create a echo struct.
|
||||
@@ -364,6 +374,7 @@ __API__ int tos_at_echo_fuzzy_matching_create(at_echo_t *echo, char *buffer, siz
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] echo pointer to the echo struct.
|
||||
* @param[in] timeout command wait timeout .
|
||||
* @param[in] cmd at command.
|
||||
@@ -372,7 +383,7 @@ __API__ int tos_at_echo_fuzzy_matching_create(at_echo_t *echo, char *buffer, siz
|
||||
* @retval -1 execute failed(error).
|
||||
* @retval 0 execute successfully.
|
||||
*/
|
||||
__API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
|
||||
__API__ int tos_at_cmd_exec(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
|
||||
|
||||
/**
|
||||
* @brief Execute an at command.
|
||||
@@ -380,6 +391,7 @@ __API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd,
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] echo pointer to the echo struct.
|
||||
* @param[in] timeout command wait timeout .
|
||||
* @param[in] cmd at command.
|
||||
@@ -388,13 +400,14 @@ __API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd,
|
||||
* @retval -1 execute failed(error).
|
||||
* @retval 0 execute successfully.
|
||||
*/
|
||||
__API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
|
||||
__API__ int tos_at_cmd_exec_until(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
|
||||
|
||||
/**
|
||||
* @brief Send raw data througth uart.
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] echo pointer to the echo struct.
|
||||
* @param[in] timeout command wait timeout .
|
||||
* @param[in] buf data to send.
|
||||
@@ -404,7 +417,7 @@ __API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char
|
||||
* @retval -1 execute failed(error).
|
||||
* @retval 0 execute successfully.
|
||||
*/
|
||||
__API__ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
|
||||
__API__ int tos_at_raw_data_send(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Send raw data througth uart.
|
||||
@@ -412,6 +425,7 @@ __API__ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] echo pointer to the echo struct.
|
||||
* @param[in] timeout command wait timeout .
|
||||
* @param[in] buf data to send.
|
||||
@@ -421,7 +435,7 @@ __API__ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_
|
||||
* @retval -1 execute failed(error).
|
||||
* @retval 0 execute successfully.
|
||||
*/
|
||||
__API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
|
||||
__API__ int tos_at_raw_data_send_until(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
|
||||
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
/**
|
||||
@@ -430,12 +444,13 @@ __API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] pdata pointer of the uart received data.
|
||||
* @param[in] len length of the uart received data.
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] pdata pointer of the uart received data.
|
||||
* @param[in] len length of the uart received data.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
__API__ void tos_at_uart_input_frame(uint8_t *pdata, uint16_t len);
|
||||
__API__ void tos_at_uart_input_frame(at_agent_t *at_agent, uint8_t *pdata, uint16_t len);
|
||||
|
||||
#elif AT_INPUT_SIMULATE_IDLE_EN
|
||||
/**
|
||||
@@ -444,11 +459,12 @@ __API__ void tos_at_uart_input_frame(uint8_t *pdata, uint16_t len);
|
||||
*
|
||||
* @attention No notification is given after writing.
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] data uart received data.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
__API__ void tos_at_uart_input_byte_no_notify(uint8_t data);
|
||||
__API__ void tos_at_uart_input_byte_no_notify(at_agent_t *at_agent, uint8_t data);
|
||||
#else
|
||||
/**
|
||||
* @brief Write byte to the at uart.
|
||||
@@ -456,11 +472,12 @@ __API__ void tos_at_uart_input_byte_no_notify(uint8_t data);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] data uart received data.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
__API__ void tos_at_uart_input_byte(uint8_t data);
|
||||
__API__ void tos_at_uart_input_byte(at_agent_t *at_agent, uint8_t data);
|
||||
#endif
|
||||
/**
|
||||
* @brief A global lock provided by at framework.
|
||||
@@ -468,13 +485,13 @@ __API__ void tos_at_uart_input_byte(uint8_t data);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param None.
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
*
|
||||
* @return errcode
|
||||
* @retval -1 pend failed(error).
|
||||
* @retval 0 pend successfully.
|
||||
*/
|
||||
__API__ int tos_at_global_lock_pend(void);
|
||||
__API__ int tos_at_global_lock_pend(at_agent_t *at_agent);
|
||||
|
||||
/**
|
||||
* @brief A global lock provided by at framework.
|
||||
@@ -482,13 +499,13 @@ __API__ int tos_at_global_lock_pend(void);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param None.
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
*
|
||||
* @return errcode
|
||||
* @retval -1 post failed(error).
|
||||
* @retval 0 post successfully.
|
||||
*/
|
||||
__API__ int tos_at_global_lock_post(void);
|
||||
__API__ int tos_at_global_lock_post(at_agent_t *at_agent);
|
||||
|
||||
/**
|
||||
* @brief Read data from the uart.
|
||||
@@ -496,12 +513,13 @@ __API__ int tos_at_global_lock_post(void);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[out] buffer buffer to hold the data read from the uart.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
*
|
||||
* @return length of the data read from the uart.
|
||||
*/
|
||||
__API__ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len);
|
||||
__API__ int tos_at_uart_read(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len);
|
||||
|
||||
/**
|
||||
* @brief Read data from the uart.
|
||||
@@ -509,12 +527,13 @@ __API__ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[out] buffer buffer to hold the data read from the uart.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
*
|
||||
* @return length of the data read from the uart.
|
||||
*/
|
||||
__API__ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len);
|
||||
__API__ int tos_at_uart_readline(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len);
|
||||
|
||||
/**
|
||||
* @brief Read data from the uart.
|
||||
@@ -522,12 +541,13 @@ __API__ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[out] buffer buffer to hold the data read from the uart.
|
||||
* @param[in] buffer_len length of the buffer.
|
||||
*
|
||||
* @return length of the data read from the uart.
|
||||
*/
|
||||
__API__ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len);
|
||||
__API__ int tos_at_uart_drain(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len);
|
||||
|
||||
/**
|
||||
* @brief Get the remote ip of a channel.
|
||||
@@ -535,11 +555,12 @@ __API__ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
*
|
||||
* @return remote ip of the channel.
|
||||
*/
|
||||
__API__ const char *tos_at_channel_ip_get(int channel_id);
|
||||
__API__ const char *tos_at_channel_ip_get(at_agent_t *at_agent, int channel_id);
|
||||
|
||||
/**
|
||||
* @brief Get the remote port of a channel.
|
||||
@@ -547,11 +568,12 @@ __API__ const char *tos_at_channel_ip_get(int channel_id);
|
||||
*
|
||||
* @attention None
|
||||
*
|
||||
* @param[in] at_agent pointer to the at agent struct.
|
||||
* @param[in] channel_id id of the channel.
|
||||
*
|
||||
* @return remote port of the channel.
|
||||
*/
|
||||
__API__ const char *tos_at_channel_port_get(int channel_id);
|
||||
__API__ const char *tos_at_channel_port_get(at_agent_t *at_agent, int channel_id);
|
||||
|
||||
#endif /* _TOS_AT_H_ */
|
||||
|
||||
|
@@ -26,65 +26,61 @@ Note:
|
||||
|
||||
#include "tos_at.h"
|
||||
|
||||
__STATIC__ at_agent_t at_agent;
|
||||
|
||||
__STATIC__ k_stack_t at_parser_task_stack[AT_PARSER_TASK_STACK_SIZE];
|
||||
|
||||
__API__ int tos_at_global_lock_pend(void)
|
||||
__API__ int tos_at_global_lock_pend(at_agent_t *at_agent)
|
||||
{
|
||||
if (tos_mutex_pend(&AT_AGENT->global_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_pend(&at_agent->global_lock) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
__API__ int tos_at_global_lock_post(void)
|
||||
__API__ int tos_at_global_lock_post(at_agent_t *at_agent)
|
||||
{
|
||||
if (tos_mutex_post(&AT_AGENT->global_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_post(&at_agent->global_lock) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
__STATIC__ int at_uart_getchar_from_fifo(uint8_t *data)
|
||||
__STATIC__ int at_uart_getchar_from_fifo(at_agent_t *at_agent, uint8_t *data)
|
||||
{
|
||||
TOS_CPU_CPSR_ALLOC();
|
||||
k_err_t err;
|
||||
|
||||
TOS_CPU_INT_DISABLE();
|
||||
err = tos_chr_fifo_pop(&AT_AGENT->uart_rx_fifo, data);
|
||||
err = tos_chr_fifo_pop(&at_agent->uart_rx_fifo, data);
|
||||
TOS_CPU_INT_ENABLE();
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
__STATIC__ int at_uart_getchar(uint8_t *data, k_tick_t timeout)
|
||||
__STATIC__ int at_uart_getchar(at_agent_t *at_agent, uint8_t *data, k_tick_t timeout)
|
||||
{
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
at_frame_len_mail_t frame_len_mail;
|
||||
size_t mail_size;
|
||||
|
||||
if (AT_AGENT->fifo_available_len == 0) {
|
||||
if (tos_mail_q_pend(&AT_AGENT->uart_rx_frame_mail, &frame_len_mail, &mail_size, timeout) != K_ERR_NONE) {
|
||||
if (at_agent->fifo_available_len == 0) {
|
||||
if (tos_mail_q_pend(&at_agent->uart_rx_frame_mail, &frame_len_mail, &mail_size, timeout) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
AT_AGENT->fifo_available_len = frame_len_mail.frame_len;
|
||||
at_agent->fifo_available_len = frame_len_mail.frame_len;
|
||||
}
|
||||
|
||||
if (at_uart_getchar_from_fifo(data) != K_ERR_NONE) {
|
||||
if (at_uart_getchar_from_fifo(at_agent, data) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
AT_AGENT->fifo_available_len -= 1;
|
||||
at_agent->fifo_available_len -= 1;
|
||||
return 0;
|
||||
#elif AT_INPUT_SIMULATE_IDLE_EN
|
||||
if (tos_chr_fifo_is_empty(&AT_AGENT->uart_rx_fifo)) {
|
||||
if (tos_sem_pend(&AT_AGENT->uart_rx_sem, timeout) != K_ERR_NONE) {
|
||||
if (tos_chr_fifo_is_empty(&at_agent->uart_rx_fifo)) {
|
||||
if (tos_sem_pend(&at_agent->uart_rx_sem, timeout) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (at_uart_getchar_from_fifo(data) != K_ERR_NONE) {
|
||||
if (at_uart_getchar_from_fifo(at_agent, data) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -93,7 +89,7 @@ __STATIC__ int at_uart_getchar(uint8_t *data, k_tick_t timeout)
|
||||
#else
|
||||
tos_stopwatch_delay(1);
|
||||
|
||||
if (tos_sem_pend(&AT_AGENT->uart_rx_sem, timeout) != K_ERR_NONE) {
|
||||
if (tos_sem_pend(&at_agent->uart_rx_sem, timeout) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -103,28 +99,28 @@ __STATIC__ int at_uart_getchar(uint8_t *data, k_tick_t timeout)
|
||||
so it is more effective to use critical sections.
|
||||
*/
|
||||
|
||||
// if (tos_mutex_pend(&AT_AGENT->uart_rx_lock) != K_ERR_NONE) {
|
||||
// if (tos_mutex_pend(&at_agent->uart_rx_lock) != K_ERR_NONE) {
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
if (at_uart_getchar_from_fifo(data) != K_ERR_NONE) {
|
||||
if (at_uart_getchar_from_fifo(at_agent, data) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// tos_mutex_post(&AT_AGENT->uart_rx_lock);
|
||||
// tos_mutex_post(&at_agent->uart_rx_lock);
|
||||
|
||||
return 0;
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
}
|
||||
|
||||
__STATIC__ at_event_t *at_event_do_get(char *buffer, size_t buffer_len)
|
||||
__STATIC__ at_event_t *at_event_do_get(at_agent_t *at_agent, char *buffer, size_t buffer_len)
|
||||
{
|
||||
int i = 0;
|
||||
at_event_t *event_table = K_NULL, *event = K_NULL;
|
||||
size_t event_table_size = 0, event_len;
|
||||
|
||||
event_table = AT_AGENT->event_table;
|
||||
event_table_size = AT_AGENT->event_table_size;
|
||||
event_table = at_agent->event_table;
|
||||
event_table_size = at_agent->event_table_size;
|
||||
|
||||
for (i = 0; i < event_table_size; ++i) {
|
||||
event = &event_table[i];
|
||||
@@ -142,27 +138,27 @@ __STATIC__ at_event_t *at_event_do_get(char *buffer, size_t buffer_len)
|
||||
return K_NULL;
|
||||
}
|
||||
|
||||
__STATIC__ at_event_t *at_get_event(void)
|
||||
__STATIC__ at_event_t *at_get_event(at_agent_t *at_agent)
|
||||
{
|
||||
char *buffer;
|
||||
size_t buffer_len;
|
||||
at_cache_t *at_cache = K_NULL;
|
||||
|
||||
at_cache = &AT_AGENT->recv_cache;
|
||||
at_cache = &at_agent->recv_cache;
|
||||
|
||||
buffer = (char *)at_cache->buffer;
|
||||
buffer_len = at_cache->recv_len;
|
||||
|
||||
return at_event_do_get(buffer, buffer_len);
|
||||
return at_event_do_get(at_agent, buffer, buffer_len);
|
||||
}
|
||||
|
||||
__API__ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len)
|
||||
__API__ int tos_at_uart_read(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len)
|
||||
{
|
||||
uint8_t data;
|
||||
size_t read_len = 0;
|
||||
|
||||
while (K_TRUE) {
|
||||
if (at_uart_getchar(&data, TOS_TIME_FOREVER) != 0) {
|
||||
if (at_uart_getchar(at_agent, &data, TOS_TIME_FOREVER) != 0) {
|
||||
return read_len;
|
||||
}
|
||||
|
||||
@@ -174,13 +170,13 @@ __API__ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len)
|
||||
}
|
||||
}
|
||||
|
||||
__API__ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len)
|
||||
__API__ int tos_at_uart_readline(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len)
|
||||
{
|
||||
uint8_t data;
|
||||
size_t read_len = 0;
|
||||
|
||||
while (K_TRUE) {
|
||||
if (at_uart_getchar(&data, TOS_TIME_FOREVER) != 0) {
|
||||
if (at_uart_getchar(at_agent, &data, TOS_TIME_FOREVER) != 0) {
|
||||
return read_len;
|
||||
}
|
||||
|
||||
@@ -194,13 +190,13 @@ __API__ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len)
|
||||
}
|
||||
}
|
||||
|
||||
__API__ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len)
|
||||
__API__ int tos_at_uart_drain(at_agent_t *at_agent, uint8_t *buffer, size_t buffer_len)
|
||||
{
|
||||
uint8_t data;
|
||||
size_t read_len = 0;
|
||||
|
||||
while (K_TRUE) {
|
||||
if (at_uart_getchar(&data, TOS_TIME_NOWAIT) != 0) {
|
||||
if (at_uart_getchar(at_agent, &data, TOS_TIME_NOWAIT) != 0) {
|
||||
return read_len;
|
||||
}
|
||||
|
||||
@@ -212,20 +208,20 @@ __API__ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len)
|
||||
}
|
||||
}
|
||||
|
||||
__STATIC__ int at_is_echo_expect(void)
|
||||
__STATIC__ int at_is_echo_expect(at_agent_t *at_agent)
|
||||
{
|
||||
char *recv_buffer, *expect;
|
||||
size_t recv_buffer_len, expect_len;
|
||||
at_echo_t *at_echo = K_NULL;
|
||||
at_cache_t *at_cache = K_NULL;
|
||||
|
||||
at_echo = AT_AGENT->echo;
|
||||
at_echo = at_agent->echo;
|
||||
|
||||
if (!at_echo || !at_echo->echo_expect) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
at_cache = &AT_AGENT->recv_cache;
|
||||
at_cache = &at_agent->recv_cache;
|
||||
|
||||
recv_buffer = (char *)at_cache->buffer;
|
||||
recv_buffer_len = at_cache->recv_len;
|
||||
@@ -251,19 +247,19 @@ __STATIC__ int at_is_echo_expect(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__STATIC__ at_parse_status_t at_uart_line_parse(void)
|
||||
__STATIC__ at_parse_status_t at_uart_line_parse(at_agent_t *at_agent)
|
||||
{
|
||||
size_t curr_len = 0;
|
||||
uint8_t data, last_data = 0;
|
||||
at_cache_t *recv_cache = K_NULL;
|
||||
|
||||
recv_cache = &AT_AGENT->recv_cache;
|
||||
recv_cache = &at_agent->recv_cache;
|
||||
|
||||
recv_cache->recv_len = 0;
|
||||
memset(recv_cache->buffer, 0, recv_cache->buffer_size);
|
||||
|
||||
while (K_TRUE) {
|
||||
if (at_uart_getchar(&data, TOS_TIME_FOREVER) != 0) {
|
||||
if (at_uart_getchar(at_agent, &data, TOS_TIME_FOREVER) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -279,11 +275,11 @@ __STATIC__ at_parse_status_t at_uart_line_parse(void)
|
||||
return AT_PARSE_STATUS_OVERFLOW;
|
||||
}
|
||||
|
||||
if (at_get_event() != K_NULL) {
|
||||
if (at_get_event(at_agent) != K_NULL) {
|
||||
return AT_PARSE_STATUS_EVENT;
|
||||
}
|
||||
|
||||
if (at_is_echo_expect()) {
|
||||
if (at_is_echo_expect(at_agent)) {
|
||||
return AT_PARSE_STATUS_EXPECT;
|
||||
}
|
||||
|
||||
@@ -343,11 +339,13 @@ __STATIC__ void at_parser(void *arg)
|
||||
at_cache_t *recv_cache = K_NULL;
|
||||
at_parse_status_t at_parse_status;
|
||||
|
||||
recv_cache = &AT_AGENT->recv_cache;
|
||||
at_agent_t *at_agent = (at_agent_t *)arg;
|
||||
|
||||
recv_cache = &at_agent->recv_cache;
|
||||
|
||||
while (K_TRUE) {
|
||||
|
||||
at_parse_status = at_uart_line_parse();
|
||||
at_parse_status = at_uart_line_parse(at_agent);
|
||||
|
||||
AT_LOG("at line parser end!(%d)\r\n", at_parse_status);
|
||||
|
||||
@@ -359,14 +357,14 @@ __STATIC__ void at_parser(void *arg)
|
||||
}
|
||||
|
||||
if (at_parse_status == AT_PARSE_STATUS_EVENT) {
|
||||
at_event = at_get_event();
|
||||
at_event = at_get_event(at_agent);
|
||||
if (at_event && at_event->event_callback) {
|
||||
at_event->event_callback();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
at_echo = AT_AGENT->echo;
|
||||
at_echo = at_agent->echo;
|
||||
if (!at_echo) {
|
||||
continue;
|
||||
}
|
||||
@@ -399,13 +397,13 @@ __STATIC__ void at_parser(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
__STATIC__ int at_uart_send(const uint8_t *buf, size_t size, uint32_t timeout)
|
||||
__STATIC__ int at_uart_send(at_agent_t *at_agent, const uint8_t *buf, size_t size, uint32_t timeout)
|
||||
{
|
||||
int ret;
|
||||
|
||||
tos_mutex_pend(&AT_AGENT->uart_tx_lock);
|
||||
ret = tos_hal_uart_write(&AT_AGENT->uart, buf, size, timeout);
|
||||
tos_mutex_post(&AT_AGENT->uart_tx_lock);
|
||||
tos_mutex_pend(&at_agent->uart_tx_lock);
|
||||
ret = tos_hal_uart_write(&at_agent->uart, buf, size, timeout);
|
||||
tos_mutex_post(&at_agent->uart_tx_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -459,30 +457,30 @@ __STATIC_INLINE__ void at_echo_flush(at_echo_t *echo)
|
||||
echo->__w_idx = 0;
|
||||
}
|
||||
|
||||
__STATIC_INLINE__ void at_echo_attach(at_echo_t *echo)
|
||||
__STATIC_INLINE__ void at_echo_attach(at_agent_t *at_agent, at_echo_t *echo)
|
||||
{
|
||||
at_echo_flush(echo);
|
||||
AT_AGENT->echo = echo;
|
||||
at_agent->echo = echo;
|
||||
}
|
||||
|
||||
__API__ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size)
|
||||
__API__ int tos_at_raw_data_send(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (echo) {
|
||||
at_echo_attach(echo);
|
||||
at_echo_attach(at_agent, echo);
|
||||
}
|
||||
|
||||
ret = at_uart_send(buf, size, 0xFFFF);
|
||||
ret = at_uart_send(at_agent, buf, size, 0xFFFF);
|
||||
|
||||
tos_task_delay(tos_millisec2tick(timeout));
|
||||
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
__API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size)
|
||||
__API__ int tos_at_raw_data_send_until(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -494,9 +492,9 @@ __API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const
|
||||
return -1;
|
||||
}
|
||||
echo->__is_expecting = K_TRUE;
|
||||
at_echo_attach(echo);
|
||||
at_echo_attach(at_agent, echo);
|
||||
|
||||
ret = at_uart_send(buf, size, 0xFFFF);
|
||||
ret = at_uart_send(at_agent, buf, size, 0xFFFF);
|
||||
|
||||
if (tos_sem_pend(&echo->__expect_notify, tos_millisec2tick(timeout)) != K_ERR_NONE) {
|
||||
ret = -1;
|
||||
@@ -504,31 +502,31 @@ __API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const
|
||||
|
||||
tos_sem_destroy(&echo->__expect_notify);
|
||||
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
__STATIC__ int at_cmd_do_exec(const char *format, va_list args)
|
||||
__STATIC__ int at_cmd_do_exec(at_agent_t *at_agent, const char *format, va_list args)
|
||||
{
|
||||
size_t cmd_len = 0;
|
||||
|
||||
if (tos_mutex_pend(&AT_AGENT->cmd_buf_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_pend(&at_agent->cmd_buf_lock) != K_ERR_NONE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
cmd_len = vsnprintf(AT_AGENT->cmd_buf, AT_CMD_BUFFER_SIZE, format, args);
|
||||
cmd_len = vsnprintf(at_agent->cmd_buf, AT_CMD_BUFFER_SIZE, format, args);
|
||||
|
||||
tos_kprintln("AT CMD:\n%s\n", AT_AGENT->cmd_buf);
|
||||
tos_kprintln("AT CMD:\n%s\n", at_agent->cmd_buf);
|
||||
|
||||
at_uart_send((uint8_t *)AT_AGENT->cmd_buf, cmd_len, 0xFFFF);
|
||||
at_uart_send(at_agent, (uint8_t *)at_agent->cmd_buf, cmd_len, 0xFFFF);
|
||||
|
||||
tos_mutex_post(&AT_AGENT->cmd_buf_lock);
|
||||
tos_mutex_post(&at_agent->cmd_buf_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd, ...)
|
||||
__API__ int tos_at_cmd_exec(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const char *cmd, ...)
|
||||
{
|
||||
int ret = 0;
|
||||
va_list args;
|
||||
@@ -541,14 +539,14 @@ __API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd,
|
||||
return -1;
|
||||
}
|
||||
|
||||
at_echo_attach(echo);
|
||||
at_echo_attach(at_agent, echo);
|
||||
|
||||
va_start(args, cmd);
|
||||
ret = at_cmd_do_exec(cmd, args);
|
||||
ret = at_cmd_do_exec(at_agent, cmd, args);
|
||||
va_end(args);
|
||||
|
||||
if (ret != 0) {
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -558,12 +556,12 @@ __API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd,
|
||||
|
||||
tos_sem_destroy(&echo->__status_set_notify);
|
||||
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
__API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char *cmd, ...)
|
||||
__API__ int tos_at_cmd_exec_until(at_agent_t *at_agent, at_echo_t *echo, uint32_t timeout, const char *cmd, ...)
|
||||
{
|
||||
int ret = 0;
|
||||
va_list args;
|
||||
@@ -576,14 +574,14 @@ __API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char
|
||||
return -1;
|
||||
}
|
||||
echo->__is_expecting = K_TRUE;
|
||||
at_echo_attach(echo);
|
||||
at_echo_attach(at_agent, echo);
|
||||
|
||||
va_start(args, cmd);
|
||||
ret = at_cmd_do_exec(cmd, args);
|
||||
ret = at_cmd_do_exec(at_agent, cmd, args);
|
||||
va_end(args);
|
||||
|
||||
if (ret != 0) {
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -593,42 +591,42 @@ __API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char
|
||||
|
||||
tos_sem_destroy(&echo->__expect_notify);
|
||||
|
||||
AT_AGENT->echo = K_NULL;
|
||||
at_agent->echo = K_NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
__STATIC__ int at_recv_cache_init(void)
|
||||
__STATIC__ int at_recv_cache_init(at_agent_t *at_agent)
|
||||
{
|
||||
uint8_t *buffer = K_NULL;
|
||||
|
||||
buffer = tos_mmheap_alloc(AT_RECV_CACHE_SIZE);
|
||||
if (!buffer) {
|
||||
AT_AGENT->recv_cache.buffer = K_NULL;
|
||||
at_agent->recv_cache.buffer = K_NULL;
|
||||
return - 1;
|
||||
}
|
||||
|
||||
AT_AGENT->recv_cache.buffer = buffer;
|
||||
AT_AGENT->recv_cache.buffer_size = AT_RECV_CACHE_SIZE;
|
||||
AT_AGENT->recv_cache.recv_len = 0;
|
||||
at_agent->recv_cache.buffer = buffer;
|
||||
at_agent->recv_cache.buffer_size = AT_RECV_CACHE_SIZE;
|
||||
at_agent->recv_cache.recv_len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__STATIC__ void at_recv_cache_deinit(void)
|
||||
__STATIC__ void at_recv_cache_deinit(at_agent_t *at_agent)
|
||||
{
|
||||
uint8_t *buffer = K_NULL;
|
||||
|
||||
buffer = AT_AGENT->recv_cache.buffer;
|
||||
buffer = at_agent->recv_cache.buffer;
|
||||
if (buffer) {
|
||||
tos_mmheap_free(buffer);
|
||||
}
|
||||
|
||||
AT_AGENT->recv_cache.buffer = K_NULL;
|
||||
AT_AGENT->recv_cache.buffer_size = 0;
|
||||
AT_AGENT->recv_cache.recv_len = 0;
|
||||
at_agent->recv_cache.buffer = K_NULL;
|
||||
at_agent->recv_cache.buffer_size = 0;
|
||||
at_agent->recv_cache.recv_len = 0;
|
||||
}
|
||||
|
||||
__STATIC__ at_data_channel_t *at_channel_get(int channel_id, int is_alloc)
|
||||
__STATIC__ at_data_channel_t *at_channel_get(at_agent_t *at_agent, int channel_id, int is_alloc)
|
||||
{
|
||||
/*
|
||||
if is_alloc is K_TRUE, means we are allocating a channel with certain id,
|
||||
@@ -642,7 +640,7 @@ __STATIC__ at_data_channel_t *at_channel_get(int channel_id, int is_alloc)
|
||||
return K_NULL;
|
||||
}
|
||||
|
||||
data_channel = &AT_AGENT->data_channel[channel_id];
|
||||
data_channel = &at_agent->data_channel[channel_id];
|
||||
|
||||
if (is_alloc && data_channel->is_free) {
|
||||
return data_channel;
|
||||
@@ -655,13 +653,13 @@ __STATIC__ at_data_channel_t *at_channel_get(int channel_id, int is_alloc)
|
||||
return K_NULL;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len)
|
||||
__API__ int tos_at_channel_read(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len)
|
||||
{
|
||||
int read_len;
|
||||
size_t total_read_len = 0;
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel || data_channel->status == AT_CHANNEL_STATUS_BROKEN) {
|
||||
return -1;
|
||||
}
|
||||
@@ -684,14 +682,14 @@ __API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_l
|
||||
}
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout)
|
||||
__API__ int tos_at_channel_read_timed(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout)
|
||||
{
|
||||
int read_len = 0;
|
||||
size_t total_read_len = 0;
|
||||
k_tick_t remain_tick;
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel || data_channel->status == AT_CHANNEL_STATUS_BROKEN) {
|
||||
return -1;
|
||||
}
|
||||
@@ -729,12 +727,12 @@ __API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t bu
|
||||
return total_read_len;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len)
|
||||
__API__ int tos_at_channel_write(at_agent_t *at_agent, int channel_id, uint8_t *buffer, size_t buffer_len)
|
||||
{
|
||||
int ret;
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel) {
|
||||
return -1;
|
||||
}
|
||||
@@ -788,12 +786,12 @@ errout:
|
||||
return -1;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port)
|
||||
__API__ int tos_at_channel_alloc_id(at_agent_t *at_agent, int channel_id, const char *ip, const char *port)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
size_t socket_buffer_size = 0;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_TRUE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_TRUE);
|
||||
if (!data_channel) {
|
||||
return -1;
|
||||
}
|
||||
@@ -806,14 +804,14 @@ __API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *
|
||||
return channel_id;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_alloc(const char *ip, const char *port)
|
||||
__API__ int tos_at_channel_alloc(at_agent_t *at_agent, const char *ip, const char *port)
|
||||
{
|
||||
int id = 0;
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
size_t socket_buffer_size = 0;
|
||||
|
||||
for (id = 0; id < AT_DATA_CHANNEL_NUM; ++id) {
|
||||
data_channel = &AT_AGENT->data_channel[id];
|
||||
data_channel = &at_agent->data_channel[id];
|
||||
if (data_channel->is_free) {
|
||||
break;
|
||||
}
|
||||
@@ -831,13 +829,13 @@ __API__ int tos_at_channel_alloc(const char *ip, const char *port)
|
||||
return id;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_alloc_with_size(const char *ip, const char *port, size_t socket_buffer_size)
|
||||
__API__ int tos_at_channel_alloc_with_size(at_agent_t *at_agent, const char *ip, const char *port, size_t socket_buffer_size)
|
||||
{
|
||||
int id = 0;
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
for (id = 0; id < AT_DATA_CHANNEL_NUM; ++id) {
|
||||
data_channel = &AT_AGENT->data_channel[id];
|
||||
data_channel = &at_agent->data_channel[id];
|
||||
if (data_channel->is_free) {
|
||||
break;
|
||||
}
|
||||
@@ -854,11 +852,11 @@ __API__ int tos_at_channel_alloc_with_size(const char *ip, const char *port, siz
|
||||
return id;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_free(int channel_id)
|
||||
__API__ int tos_at_channel_free(at_agent_t *at_agent, int channel_id)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel) {
|
||||
return -1;
|
||||
}
|
||||
@@ -880,11 +878,11 @@ __API__ int tos_at_channel_free(int channel_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_set_broken(int channel_id)
|
||||
__API__ int tos_at_channel_set_broken(at_agent_t *at_agent, int channel_id)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel) {
|
||||
return -1;
|
||||
}
|
||||
@@ -893,39 +891,39 @@ __API__ int tos_at_channel_set_broken(int channel_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__API__ int tos_at_channel_is_working(int channel_id)
|
||||
__API__ int tos_at_channel_is_working(at_agent_t *at_agent, int channel_id)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
return data_channel && data_channel->status == AT_CHANNEL_STATUS_WORKING;
|
||||
}
|
||||
|
||||
__STATIC__ void at_channel_init(void)
|
||||
__STATIC__ void at_channel_init(at_agent_t *at_agent)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < AT_DATA_CHANNEL_NUM; ++i) {
|
||||
memset(&AT_AGENT->data_channel[i], 0, sizeof(at_data_channel_t));
|
||||
AT_AGENT->data_channel[i].is_free = K_TRUE;
|
||||
AT_AGENT->data_channel[i].status = AT_CHANNEL_STATUS_HANGING;
|
||||
memset(&at_agent->data_channel[i], 0, sizeof(at_data_channel_t));
|
||||
at_agent->data_channel[i].is_free = K_TRUE;
|
||||
at_agent->data_channel[i].status = AT_CHANNEL_STATUS_HANGING;
|
||||
}
|
||||
}
|
||||
|
||||
__STATIC__ void at_channel_deinit(void)
|
||||
__STATIC__ void at_channel_deinit(at_agent_t *at_agent)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < AT_DATA_CHANNEL_NUM; ++i) {
|
||||
tos_at_channel_free(i);
|
||||
tos_at_channel_free(at_agent, i);
|
||||
}
|
||||
}
|
||||
|
||||
__API__ const char *tos_at_channel_ip_get(int channel_id)
|
||||
__API__ const char *tos_at_channel_ip_get(at_agent_t *at_agent, int channel_id)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel) {
|
||||
return K_NULL;
|
||||
}
|
||||
@@ -933,11 +931,11 @@ __API__ const char *tos_at_channel_ip_get(int channel_id)
|
||||
return data_channel->remote_ip;
|
||||
}
|
||||
|
||||
__API__ const char *tos_at_channel_port_get(int channel_id)
|
||||
__API__ const char *tos_at_channel_port_get(at_agent_t *at_agent, int channel_id)
|
||||
{
|
||||
at_data_channel_t *data_channel = K_NULL;
|
||||
|
||||
data_channel = at_channel_get(channel_id, K_FALSE);
|
||||
data_channel = at_channel_get(at_agent, channel_id, K_FALSE);
|
||||
if (!data_channel) {
|
||||
return K_NULL;
|
||||
}
|
||||
@@ -945,54 +943,55 @@ __API__ const char *tos_at_channel_port_get(int channel_id)
|
||||
return data_channel->remote_port;
|
||||
}
|
||||
|
||||
__STATIC__ void at_event_table_set(at_event_t *event_table, size_t event_table_size)
|
||||
__STATIC__ void at_event_table_set(at_agent_t *at_agent, at_event_t *event_table, size_t event_table_size)
|
||||
{
|
||||
AT_AGENT->event_table = event_table;
|
||||
AT_AGENT->event_table_size = event_table_size;
|
||||
at_agent->event_table = event_table;
|
||||
at_agent->event_table_size = event_table_size;
|
||||
}
|
||||
|
||||
#if AT_INPUT_SIMULATE_IDLE_EN
|
||||
|
||||
__STATIC__ void tos_at_uart_input_notify()
|
||||
__STATIC__ void tos_at_uart_input_notify(at_agent_t *at_agent)
|
||||
{
|
||||
tos_sem_post(&AT_AGENT->uart_rx_sem);
|
||||
tos_sem_post(&at_agent->uart_rx_sem);
|
||||
}
|
||||
|
||||
__STATIC__ void idle_check_timer_callback(void *args)
|
||||
{
|
||||
tos_at_uart_input_notify();
|
||||
at_agent_t *at_agent = (at_agent_t *)args;
|
||||
tos_at_uart_input_notify(at_agent);
|
||||
}
|
||||
#endif /* #if AT_INPUT_SIMULATE_IDLE_EN */
|
||||
|
||||
__API__ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size)
|
||||
__API__ int tos_at_init(at_agent_t *at_agent, char *task_name, k_stack_t *stk, hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size)
|
||||
{
|
||||
void *buffer = K_NULL;
|
||||
|
||||
memset(AT_AGENT, 0, sizeof(at_agent_t));
|
||||
memset(at_agent, 0, sizeof(at_agent_t));
|
||||
|
||||
at_event_table_set(event_table, event_table_size);
|
||||
at_event_table_set(at_agent, event_table, event_table_size);
|
||||
|
||||
at_channel_init();
|
||||
at_channel_init(at_agent);
|
||||
|
||||
buffer = tos_mmheap_alloc(AT_UART_RX_FIFO_BUFFER_SIZE);
|
||||
if (!buffer) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
AT_AGENT->uart_rx_fifo_buffer = (uint8_t *)buffer;
|
||||
tos_chr_fifo_create(&AT_AGENT->uart_rx_fifo, buffer, AT_UART_RX_FIFO_BUFFER_SIZE);
|
||||
at_agent->uart_rx_fifo_buffer = (uint8_t *)buffer;
|
||||
tos_chr_fifo_create(&at_agent->uart_rx_fifo, buffer, AT_UART_RX_FIFO_BUFFER_SIZE);
|
||||
|
||||
buffer = tos_mmheap_alloc(AT_CMD_BUFFER_SIZE);
|
||||
if (!buffer) {
|
||||
goto errout0;
|
||||
}
|
||||
AT_AGENT->cmd_buf = (char *)buffer;
|
||||
at_agent->cmd_buf = (char *)buffer;
|
||||
|
||||
if (tos_mutex_create(&AT_AGENT->cmd_buf_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_create(&at_agent->cmd_buf_lock) != K_ERR_NONE) {
|
||||
goto errout1;
|
||||
}
|
||||
|
||||
if (at_recv_cache_init() != 0) {
|
||||
if (at_recv_cache_init(at_agent) != 0) {
|
||||
goto errout2;
|
||||
}
|
||||
|
||||
@@ -1002,164 +1001,164 @@ __API__ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size
|
||||
goto errout3;
|
||||
}
|
||||
|
||||
AT_AGENT->uart_rx_frame_mail_buffer = (uint8_t *)buffer;
|
||||
at_agent->uart_rx_frame_mail_buffer = (uint8_t *)buffer;
|
||||
|
||||
if (tos_mail_q_create(&AT_AGENT->uart_rx_frame_mail, buffer, AT_FRAME_LEN_MAIL_MAX, sizeof(at_frame_len_mail_t)) != K_ERR_NONE) {
|
||||
if (tos_mail_q_create(&at_agent->uart_rx_frame_mail, buffer, AT_FRAME_LEN_MAIL_MAX, sizeof(at_frame_len_mail_t)) != K_ERR_NONE) {
|
||||
goto errout4;
|
||||
}
|
||||
#else
|
||||
if (tos_sem_create(&AT_AGENT->uart_rx_sem, (k_sem_cnt_t)0u) != K_ERR_NONE) {
|
||||
if (tos_sem_create(&at_agent->uart_rx_sem, (k_sem_cnt_t)0u) != K_ERR_NONE) {
|
||||
goto errout3;
|
||||
}
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
|
||||
// if (tos_mutex_create(&AT_AGENT->uart_rx_lock) != K_ERR_NONE) {
|
||||
// if (tos_mutex_create(&at_agent->uart_rx_lock) != K_ERR_NONE) {
|
||||
// goto errout5;
|
||||
// }
|
||||
|
||||
if (tos_mutex_create(&AT_AGENT->uart_tx_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_create(&at_agent->uart_tx_lock) != K_ERR_NONE) {
|
||||
goto errout6;
|
||||
}
|
||||
|
||||
if (tos_mutex_create(&AT_AGENT->global_lock) != K_ERR_NONE) {
|
||||
if (tos_mutex_create(&at_agent->global_lock) != K_ERR_NONE) {
|
||||
goto errout7;
|
||||
}
|
||||
|
||||
#if AT_INPUT_SIMULATE_IDLE_EN
|
||||
if (tos_timer_create(&AT_AGENT->idle_check_timer, SIMULATE_IDLE_DEFAULT_TIME,
|
||||
0, idle_check_timer_callback, NULL, TOS_OPT_TIMER_ONESHOT) != K_ERR_NONE) {
|
||||
if (tos_timer_create(&at_agent->idle_check_timer, SIMULATE_IDLE_DEFAULT_TIME,
|
||||
0, idle_check_timer_callback, at_agent, TOS_OPT_TIMER_ONESHOT) != K_ERR_NONE) {
|
||||
goto errout8;
|
||||
}
|
||||
#endif /* AT_INPUT_SIMULATE_IDLE_EN */
|
||||
|
||||
if (tos_hal_uart_init(&AT_AGENT->uart, uart_port) != 0) {
|
||||
if (tos_hal_uart_init(&at_agent->uart, uart_port) != 0) {
|
||||
goto errout9;
|
||||
}
|
||||
|
||||
if (tos_task_create(&AT_AGENT->parser, "at_parser", at_parser,
|
||||
K_NULL, AT_PARSER_TASK_PRIO, at_parser_task_stack,
|
||||
if (tos_task_create(&at_agent->parser, task_name, at_parser,
|
||||
at_agent, AT_PARSER_TASK_PRIO, stk,
|
||||
AT_PARSER_TASK_STACK_SIZE, 0) != K_ERR_NONE) {
|
||||
goto errout10;
|
||||
}
|
||||
|
||||
return 0;
|
||||
errout10:
|
||||
tos_hal_uart_deinit(&AT_AGENT->uart);
|
||||
tos_hal_uart_deinit(&at_agent->uart);
|
||||
|
||||
errout9:
|
||||
#if AT_INPUT_SIMULATE_IDLE_EN
|
||||
tos_timer_destroy(&AT_AGENT->idle_check_timer);
|
||||
tos_timer_destroy(&at_agent->idle_check_timer);
|
||||
errout8:
|
||||
#endif /* AT_INPUT_SIMULATE_IDLE_EN */
|
||||
|
||||
tos_mutex_destroy(&AT_AGENT->global_lock);
|
||||
tos_mutex_destroy(&at_agent->global_lock);
|
||||
|
||||
errout7:
|
||||
tos_mutex_destroy(&AT_AGENT->uart_tx_lock);
|
||||
tos_mutex_destroy(&at_agent->uart_tx_lock);
|
||||
|
||||
errout6:
|
||||
// tos_mutex_destroy(&AT_AGENT->uart_rx_lock);
|
||||
// tos_mutex_destroy(&at_agent->uart_rx_lock);
|
||||
|
||||
//errout5:
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
tos_mail_q_destroy(&AT_AGENT->uart_rx_frame_mail);
|
||||
tos_mail_q_destroy(&at_agent->uart_rx_frame_mail);
|
||||
#else
|
||||
tos_sem_destroy(&AT_AGENT->uart_rx_sem);
|
||||
tos_sem_destroy(&at_agent->uart_rx_sem);
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
errout4:
|
||||
tos_mmheap_free(AT_AGENT->uart_rx_frame_mail_buffer);
|
||||
AT_AGENT->uart_rx_frame_mail_buffer = K_NULL;
|
||||
tos_mmheap_free(at_agent->uart_rx_frame_mail_buffer);
|
||||
at_agent->uart_rx_frame_mail_buffer = K_NULL;
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
|
||||
errout3:
|
||||
at_recv_cache_deinit();
|
||||
at_recv_cache_deinit(at_agent);
|
||||
|
||||
errout2:
|
||||
tos_mutex_destroy(&AT_AGENT->cmd_buf_lock);
|
||||
tos_mutex_destroy(&at_agent->cmd_buf_lock);
|
||||
|
||||
errout1:
|
||||
tos_mmheap_free(AT_AGENT->cmd_buf);
|
||||
AT_AGENT->cmd_buf = K_NULL;
|
||||
tos_mmheap_free(at_agent->cmd_buf);
|
||||
at_agent->cmd_buf = K_NULL;
|
||||
|
||||
errout0:
|
||||
tos_mmheap_free(AT_AGENT->uart_rx_fifo_buffer);
|
||||
AT_AGENT->uart_rx_fifo_buffer = K_NULL;
|
||||
tos_chr_fifo_destroy(&AT_AGENT->uart_rx_fifo);
|
||||
tos_mmheap_free(at_agent->uart_rx_fifo_buffer);
|
||||
at_agent->uart_rx_fifo_buffer = K_NULL;
|
||||
tos_chr_fifo_destroy(&at_agent->uart_rx_fifo);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
__API__ void tos_at_deinit(void)
|
||||
__API__ void tos_at_deinit(at_agent_t *at_agent)
|
||||
{
|
||||
tos_task_destroy(&AT_AGENT->parser);
|
||||
tos_task_destroy(&at_agent->parser);
|
||||
|
||||
tos_hal_uart_deinit(&AT_AGENT->uart);
|
||||
tos_hal_uart_deinit(&at_agent->uart);
|
||||
|
||||
tos_mutex_destroy(&AT_AGENT->global_lock);
|
||||
tos_mutex_destroy(&at_agent->global_lock);
|
||||
|
||||
tos_mutex_destroy(&AT_AGENT->uart_tx_lock);
|
||||
tos_mutex_destroy(&at_agent->uart_tx_lock);
|
||||
|
||||
//tos_mutex_destroy(&AT_AGENT->uart_tx_lock);
|
||||
//tos_mutex_destroy(&at_agent->uart_tx_lock);
|
||||
|
||||
#if AT_INPUT_SIMULATE_IDLE_EN
|
||||
tos_timer_destroy(&AT_AGENT->idle_check_timer);
|
||||
tos_timer_destroy(&at_agent->idle_check_timer);
|
||||
#endif /* AT_INPUT_SIMULATE_IDLE_EN */
|
||||
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
tos_mail_q_destroy(&AT_AGENT->uart_rx_frame_mail);
|
||||
tos_mmheap_free(AT_AGENT->uart_rx_frame_mail_buffer);
|
||||
AT_AGENT->uart_rx_frame_mail_buffer = K_NULL;
|
||||
tos_mail_q_destroy(&at_agent->uart_rx_frame_mail);
|
||||
tos_mmheap_free(at_agent->uart_rx_frame_mail_buffer);
|
||||
at_agent->uart_rx_frame_mail_buffer = K_NULL;
|
||||
#else
|
||||
tos_sem_destroy(&AT_AGENT->uart_rx_sem);
|
||||
tos_sem_destroy(&at_agent->uart_rx_sem);
|
||||
#endif /* AT_INPUT_TYPE_FRAME_EN */
|
||||
|
||||
at_recv_cache_deinit();
|
||||
at_recv_cache_deinit(at_agent);
|
||||
|
||||
tos_mutex_destroy(&AT_AGENT->cmd_buf_lock);
|
||||
tos_mutex_destroy(&at_agent->cmd_buf_lock);
|
||||
|
||||
tos_mmheap_free(AT_AGENT->cmd_buf);
|
||||
AT_AGENT->cmd_buf = K_NULL;
|
||||
tos_mmheap_free(at_agent->cmd_buf);
|
||||
at_agent->cmd_buf = K_NULL;
|
||||
|
||||
tos_mmheap_free(AT_AGENT->uart_rx_fifo_buffer);
|
||||
AT_AGENT->uart_rx_fifo_buffer = K_NULL;
|
||||
tos_mmheap_free(at_agent->uart_rx_fifo_buffer);
|
||||
at_agent->uart_rx_fifo_buffer = K_NULL;
|
||||
|
||||
tos_chr_fifo_destroy(&AT_AGENT->uart_rx_fifo);
|
||||
tos_chr_fifo_destroy(&at_agent->uart_rx_fifo);
|
||||
|
||||
at_channel_deinit();
|
||||
at_channel_deinit(at_agent);
|
||||
}
|
||||
|
||||
/* To completely decouple the uart intterupt and at agent, we need a more powerful
|
||||
hal(driver framework), that would be a huge work, we place it in future plans. */
|
||||
#if AT_INPUT_TYPE_FRAME_EN
|
||||
__API__ void tos_at_uart_input_frame(uint8_t *pdata, uint16_t len)
|
||||
__API__ void tos_at_uart_input_frame(at_agent_t *at_agent, uint8_t *pdata, uint16_t len)
|
||||
{
|
||||
int ret;
|
||||
at_frame_len_mail_t at_frame_len_mail;
|
||||
|
||||
ret = tos_chr_fifo_push_stream(&AT_AGENT->uart_rx_fifo, pdata, len);
|
||||
ret = tos_chr_fifo_push_stream(&at_agent->uart_rx_fifo, pdata, len);
|
||||
if (ret != len) {
|
||||
return;
|
||||
}
|
||||
|
||||
at_frame_len_mail.frame_len = len;
|
||||
tos_mail_q_post(&AT_AGENT->uart_rx_frame_mail, &at_frame_len_mail, sizeof(at_frame_len_mail_t));
|
||||
tos_mail_q_post(&at_agent->uart_rx_frame_mail, &at_frame_len_mail, sizeof(at_frame_len_mail_t));
|
||||
}
|
||||
|
||||
#elif AT_INPUT_SIMULATE_IDLE_EN
|
||||
__API__ void tos_at_uart_input_byte_no_notify(uint8_t data)
|
||||
__API__ void tos_at_uart_input_byte_no_notify(at_agent_t *at_agent, uint8_t data)
|
||||
{
|
||||
tos_timer_stop(&AT_AGENT->idle_check_timer);
|
||||
tos_chr_fifo_push(&AT_AGENT->uart_rx_fifo, data);
|
||||
tos_timer_start(&AT_AGENT->idle_check_timer);
|
||||
tos_timer_stop(&at_agent->idle_check_timer);
|
||||
tos_chr_fifo_push(&at_agent->uart_rx_fifo, data);
|
||||
tos_timer_start(&at_agent->idle_check_timer);
|
||||
}
|
||||
|
||||
#else
|
||||
__API__ void tos_at_uart_input_byte(uint8_t data)
|
||||
__API__ void tos_at_uart_input_byte(at_agent_t *at_agent, uint8_t data)
|
||||
{
|
||||
if (tos_chr_fifo_push(&AT_AGENT->uart_rx_fifo, data) == K_ERR_NONE) {
|
||||
tos_sem_post(&AT_AGENT->uart_rx_sem);
|
||||
if (tos_chr_fifo_push(&at_agent->uart_rx_fifo, data) == K_ERR_NONE) {
|
||||
tos_sem_post(&at_agent->uart_rx_sem);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Enable RX interrupt. */
|
||||
/* Enable RX interrupt. */
|
||||
LPUART_EnableInterrupts(LPUART1, kLPUART_RxDataRegFullInterruptEnable);
|
||||
EnableIRQ(LPUART1_IRQn);
|
||||
} else if (port == HAL_UART_PORT_2) {
|
||||
@@ -44,7 +44,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Enable RX interrupt. */
|
||||
/* Enable RX interrupt. */
|
||||
LPUART_EnableInterrupts(LPUART2, kLPUART_RxDataRegFullInterruptEnable);
|
||||
EnableIRQ(LPUART2_IRQn);
|
||||
} else if (port == HAL_UART_PORT_3) {
|
||||
@@ -59,7 +59,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Enable RX interrupt. */
|
||||
/* Enable RX interrupt. */
|
||||
LPUART_EnableInterrupts(LPUART3, kLPUART_RxDataRegFullInterruptEnable);
|
||||
EnableIRQ(LPUART3_IRQn);
|
||||
} else if (port == HAL_UART_PORT_4) {
|
||||
@@ -74,7 +74,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Enable RX interrupt. */
|
||||
/* Enable RX interrupt. */
|
||||
LPUART_EnableInterrupts(LPUART4, kLPUART_RxDataRegFullInterruptEnable);
|
||||
EnableIRQ(LPUART4_IRQn);
|
||||
}
|
||||
|
Reference in New Issue
Block a user