修改打印信息为SYS_LOG_DBG

This commit is contained in:
OPTOC
2025-10-28 16:29:00 +08:00
parent d43b1aca73
commit ed435b4cc8
4 changed files with 43 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
#include "sertrf.h"
//设置日志打印类型
#define CONFIG_SYS_LOG_LEVEL SYS_LOG_LEVEL_INF
#define CONFIG_SYS_LOG_LEVEL SYS_LOG_LEVEL_DBG
#define SYS_LOG_DOMAIN "Seryrf"
sertrf_t sertrf;
@@ -167,13 +167,13 @@ void app_thread(void* arg)
sertrf.resend_device.handle_flag = 0;//标志位清零
break;
case RESEND_CMD_OTA_GET_PARAM:
printf("RESEND_CMD_OTA_GET_PARAM\r\n");
SYS_LOG_DBG("RESEND_CMD_OTA_GET_PARAM\r\n");
ota_parm_t ota_parm;
resend_send_data(&sertrf.resend_device, RESEND_CMD_OTA_GET_PARAM, &ota_parm, sizeof(ota_parm_t), 1000);
sertrf.resend_device.handle_flag = 0;//标志位清零
break;
case RESEND_CMD_FC_ISP_GET_PARAM:
printf("RESEND_CMD_FC_ISP_GET_PARAM\r\n");
SYS_LOG_DBG("RESEND_CMD_FC_ISP_GET_PARAM\r\n");
stmisp_parm_t stmisp_parm;
resend_send_data(&sertrf.resend_device, RESEND_CMD_FC_ISP_GET_PARAM, &stmisp_parm, sizeof(stmisp_parm), 1000);
sertrf.resend_device.handle_flag = 0;//标志位清零
@@ -427,7 +427,7 @@ void resend_user_parse(void *resend_device)
// 减6的目的是因为华哥没对MAC进行处理所以也不返回
if(sizeof(sertrf_stauct_t) - 6 != resend_parse->rx_frame.len)
{
printf("RESEND_CMD_SET_PARAM len error\r\n");
SYS_LOG_DBG("RESEND_CMD_SET_PARAM len error\r\n");
}
sertrf_stauct_t* sertrf_stauct = (sertrf_stauct_t*)resend_parse->rx_frame.payload;
@@ -444,10 +444,10 @@ void resend_user_parse(void *resend_device)
{
if(sizeof(ota_parm_t) != resend_parse->rx_frame.len)
{
printf("RESEND_CMD_OTA_GET_PARAM len error\r\n");
SYS_LOG_DBG("RESEND_CMD_OTA_GET_PARAM len error\r\n");
}
ota_parm_t* ota_parm = (ota_parm_t*)resend_parse->rx_frame.payload;
printf("RESEND_CMD_OTA_GET_PARAM %d\n", ota_parm->ota_file_size);
SYS_LOG_DBG("RESEND_CMD_OTA_GET_PARAM %d\n", ota_parm->ota_file_size);
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
}
break;
@@ -496,10 +496,10 @@ void resend_user_parse(void *resend_device)
case RESEND_CMD_FC_ISP_GET_PARAM:
if(sizeof(stmisp_parm_t) != resend_parse->rx_frame.len)
{
printf("RESEND_CMD_FC_ISP_GET_PARAM len error\r\n");
SYS_LOG_DBG("RESEND_CMD_FC_ISP_GET_PARAM len error\r\n");
}
stmisp_parm_t* stmisp_parm = (stmisp_parm_t*)resend_parse->rx_frame.payload;
printf("RESEND_CMD_FC_ISP_GET_PARAM %d\n", stmisp_parm->stmisp_file_size);
SYS_LOG_DBG("RESEND_CMD_FC_ISP_GET_PARAM %d\n", stmisp_parm->stmisp_file_size);
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
break;
case RESEND_CMD_FC_ISP_START:
@@ -520,40 +520,40 @@ void resend_user_parse(void *resend_device)
// 与isp确定通讯波特率并建立联系
if(!send_sync(&sertrf.stmisp_device, 5))
{
printf("stmisp: sync error\n");
SYS_LOG_DBG("stmisp: sync error\n");
// app_send_error_code(SERTRF_ERROR_FC_ISP_SYNC);
break;
}
else
printf("stmisp: sync ok\n");
SYS_LOG_DBG("stmisp: sync ok\n");
os_thread_sleep(100);
// 解除写保护
if(!cmd_write_unprotect(&sertrf.stmisp_device))
printf("stmisp: write unprotect error\n");
SYS_LOG_DBG("stmisp: write unprotect error\n");
else
printf("stmisp: write unprotect ok\n");
SYS_LOG_DBG("stmisp: write unprotect ok\n");
os_thread_sleep(100);
if(!send_sync(&sertrf.stmisp_device, 5))
printf("stmisp: sync error\n");
SYS_LOG_DBG("stmisp: sync error\n");
else
printf("stmisp: sync ok\n");
SYS_LOG_DBG("stmisp: sync ok\n");
os_thread_sleep(100);
boot_set_high_z_2();
// 全盘擦除
if(!cmd_extended_erase_mass(&sertrf.stmisp_device))
printf("stmisp: erase mass error\n");
SYS_LOG_DBG("stmisp: erase mass error\n");
else
printf("stmisp: erase mass ok\n");
SYS_LOG_DBG("stmisp: erase mass ok\n");
os_thread_sleep(10);
printf("stmisp: isp start\n");
SYS_LOG_DBG("stmisp: isp start\n");
sertrf.mode_status.task_state = DATA_HANDLE_ISP_DATA;
resend_send_cmd(resend_device, RESEND_CMD_ACK, 0);
@@ -581,11 +581,11 @@ void resend_user_parse(void *resend_device)
// ISP下跳转到应用层运行地址
if(cmd_go(&sertrf.stmisp_device, sertrf.fc_address))
{
printf("stmisp: go ok\n");
SYS_LOG_DBG("stmisp: go ok\n");
}
else
{
printf("stmisp: go error\n");
SYS_LOG_DBG("stmisp: go error\n");
}
//开启其他线程中相同串口的使用
sertrf.stmisp_device.flag = 0;
@@ -615,35 +615,35 @@ void Examples_run(void)
os_thread_sleep(500);
// 与isp确定通讯波特率并建立联系
if(!send_sync(&sertrf.stmisp_device, 5))
printf("stmisp: sync error\n");
SYS_LOG_DBG("stmisp: sync error\n");
else
printf("stmisp: sync ok\n");
SYS_LOG_DBG("stmisp: sync ok\n");
os_thread_sleep(100);
// 解除写保护
if(!cmd_write_unprotect(&sertrf.stmisp_device))
printf("stmisp: write unprotect error\n");
SYS_LOG_DBG("stmisp: write unprotect error\n");
else
printf("stmisp: write unprotect ok\n");
SYS_LOG_DBG("stmisp: write unprotect ok\n");
os_thread_sleep(100);
if(!send_sync(&sertrf.stmisp_device, 5))
printf("stmisp: sync error\n");
SYS_LOG_DBG("stmisp: sync error\n");
else
printf("stmisp: sync ok\n");
SYS_LOG_DBG("stmisp: sync ok\n");
os_thread_sleep(100);
boot_set_high_z();
// 全盘擦除
if(!cmd_extended_erase_mass(&sertrf.stmisp_device))
printf("stmisp: erase mass error\n");
SYS_LOG_DBG("stmisp: erase mass error\n");
else
printf("stmisp: erase mass ok\n");
SYS_LOG_DBG("stmisp: erase mass ok\n");
os_thread_sleep(10);
printf("stmisp: isp start\n");
SYS_LOG_DBG("stmisp: isp start\n");
}
int stmisp_send(void* data, uint16_t len, int timeout)