Modify printf

This commit is contained in:
songyanguang 2025-06-19 20:15:38 +08:00
parent 84e4f2c3a1
commit c5aa020398
7 changed files with 21 additions and 35 deletions

View File

@ -200,8 +200,6 @@ static int Ec801eConnect(struct Adapter *adapter, enum NetRoleType net_role, con
int try = 0;
uint8_t ec801e_cmd[64];
printf("%s enter\n", __func__);
AtSetReplyEndChar(adapter->agent, 0x4F, 0x4B);
/*step1: serial write "+++", quit transparent mode*/

View File

@ -407,7 +407,7 @@ int AdapterDeviceConnect(struct Adapter *adapter, enum NetRoleType net_role, con
if (NULL == ip_done->connect)
return -1;
printf("AdapterDeviceConnect to connect ip=%s port=%s\n", ip, port);
return ip_done->connect(adapter, net_role, ip, port, ip_type);
} else {
printf("AdapterDeviceConnect net_protocol %d not support\n", adapter->net_protocol);

View File

@ -46,8 +46,6 @@ int AdapterNetActive(void)
{
int ret = 0;
uint32_t baud_rate = BAUD_RATE_115200;
KPrintf("%s enter\n", __func__);
adapter = AdapterDeviceFindByName(ADAPTER_4G_NAME);
adapter->socket.socket_id = 0;
@ -68,13 +66,11 @@ int AdapterNetActive(void)
{
goto out;
}
KPrintf("%s success\n", __func__);
out:
if (ret < 0)
{
AdapterDeviceClose(adapter);
KPrintf("%s fail\n", __func__);
}
return ret;
@ -116,8 +112,6 @@ bool MQTT_Connect(void)
{
uint8_t TryConnect_time = 10; //尝试登录次数
KPrintf("%s enter\n", __func__);
memset(&Platform_mqtt,0,sizeof(Platform_mqtt));
#ifdef XIUOS_PLATFORM
sprintf(Platform_mqtt.ClientID,"%s",CLIENTID); //客户端ID存入缓冲区
@ -184,7 +178,8 @@ bool MQTT_Connect(void)
MQTT_Send(Platform_mqtt.Pack_buff,Platform_mqtt.Fixed_len + Platform_mqtt.Variable_len + Platform_mqtt.Payload_len);
MdelayKTask(50);
MQTT_Recv(mqtt_rxbuf, 4);
if(mqtt_rxbuf[0] == parket_connetAck[0] && mqtt_rxbuf[1] == parket_connetAck[1] && mqtt_rxbuf[2] == parket_connetAck[2] && mqtt_rxbuf[3] == parket_connetAck[3]) //连接成功
if(mqtt_rxbuf[0] == parket_connetAck[0] && mqtt_rxbuf[1] == parket_connetAck[1]
&& mqtt_rxbuf[2] == parket_connetAck[2] && mqtt_rxbuf[3] == parket_connetAck[3]) //连接成功
{
return true;
}
@ -216,8 +211,6 @@ bool MQTT_SubscribeTopic(uint8_t *topic_name)
{
uint8_t TrySub_time = 10; //尝试订阅次数
KPrintf("%s topic_name=%s\n", __func__, topic_name);
Platform_mqtt.Fixed_len = 1; //SUBSCRIBE报文,固定报头长度暂定为1
Platform_mqtt.Variable_len = 2;//SUBSCRIBE报文,可变报头长度=2,2为字节报文标识符
Platform_mqtt.Payload_len = 0; //SUBSCRIBE报文,负载数据长度暂定为0

View File

@ -268,11 +268,11 @@ handle_reset:
csrw mtvec, t0
jal SystemInit
#ifdef __BOOTLOADER /* BOOT */
#ifdef __BOOTLOADER
la t0, ota_entry
#else /* APP */
#else
la t0, entry
#endif /* BOOT */
#endif
csrw mepc, t0
mret

View File

@ -72,16 +72,13 @@ void readRomConfiguration(void) {
extern pmodule_cfg CFG; // 指向配置信息的指针
/* 从EEPROM中读取网络配置信息 */
KPrintf("%s PAGE_READ_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR);
CFG_READ(PAGE_WRITE_START_ADDR, Configbuf, MODULE_CFG_LEN);
/* 如果存储在EEPROM中的网络配置信息无效或者WCHNET还没有被主机配置过通过默认配置信息初始化WCHNET */
if ((CFG->cfgFlag[0] != checkcode1) || (CFG->cfgFlag[1] != checkcode2)) {
KPrintf("%s PAGE_ERASE_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR);
CFG_ERASE(PAGE_WRITE_START_ADDR, FLASH_PAGE_SIZE);
KPrintf("%s PAGE_WRITE_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR);
CFG_WRITE(PAGE_WRITE_START_ADDR, (u8 *)&defaultConfiguration, MODULE_CFG_LEN);
KPrintf("%s NVIC_SystemReset\n\n", __func__);
KPrintf("%s NVIC_SystemReset\n", __func__);
NVIC_SystemReset(); // 复位ch32v208
}

View File

@ -111,6 +111,6 @@ menuconfig BSP_USING_LTE
default "lte_dev1"
config LTE_TEST
bool "Enable lte test"
default y
default n
endif

View File

@ -16,24 +16,22 @@ menu "OTA function"
bool "Config as application."
endchoice
#if MCUBOOT_APPLICATION
choice
prompt "The way of OTA firmware upgrade."
default OTA_BY_PLATFORM
choice
prompt "The way of OTA firmware upgrade."
default OTA_BY_PLATFORM
config OTA_BY_PLATFORM
bool "Through IoT management platform."
select LIB_USING_MQTT
config OTA_BY_PLATFORM
bool "Through IoT management platform."
select LIB_USING_MQTT
config OTA_BY_TCPSERVER
bool "Through the public network TCP server."
select SUPPORT_CONNECTION_FRAMEWORK
select CONNECTION_ADAPTER_4G
config OTA_BY_TCPSERVER
bool "Through the public network TCP server."
select SUPPORT_CONNECTION_FRAMEWORK
select CONNECTION_ADAPTER_4G
config OTA_BY_NONE
bool "Not download firmware."
endchoice
#endif
config OTA_BY_NONE
bool "Not download firmware."
endchoice
menu "Flash area address and size configuration."
config CHIP_FLAH_BASE