From 23480ab197150979f4505501a1abe8a64796fb18 Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期五, 04 七月 2025 18:37:07 +0800 Subject: [PATCH] 初步调好发包,解决因为uwb未open导致txlen不断溢出重启问题,两边sts配置初步调好 --- keil/include/main/main.c | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-) diff --git a/keil/include/main/main.c b/keil/include/main/main.c index a195c02..0393b4b 100644 --- a/keil/include/main/main.c +++ b/keil/include/main/main.c @@ -133,7 +133,7 @@ void boot_deinit(void); void Get_batterty_Voltage(void); void Calculate_battery_percent(void); -uint8_t sleep_limit_time=1; +uint8_t sleep_limit_time=10; static void uart_receive_callback(void *dev, uint32_t err_code) { uart_receive(UART_ID0,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE,uart_receive_callback); @@ -290,20 +290,21 @@ // Reset reason reset_cause_get(); reset_cause_clear(); - // Load calibration parameters from NVM - uint32_t internal_flash = (REG_READ(0x40000018) >> 17) & 0x1; - uint32_t external_flash = (REG_READ(0x40010030) >> 28) & 0x3; - if (internal_flash || external_flash == 1) - { - WsfNvmInit(); - board_calibration_params_load(); - flash_close(FLASH_ID0); - } - else - { - board_calibration_params_default(); - } - +// // Load calibration parameters from NVM +// uint32_t internal_flash = (REG_READ(0x40000018) >> 17) & 0x1; +// uint32_t external_flash = (REG_READ(0x40010030) >> 28) & 0x3; +// if (internal_flash || external_flash == 1) +// { +// WsfNvmInit(); +// board_calibration_params_load(); +// flash_close(FLASH_ID0); +// } +// else +// { +// board_calibration_params_default(); +// } + // Load calibration parameters + board_calibration_params_load(); // Chip calibration calib_chip(); @@ -330,8 +331,9 @@ //adc_open(&usr_adc_cfg); //adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 // Enable sleep timer - Tag_uwb_init(); - sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback); + //Tag_uwb_init(); + Anchor_uwb_aoa_square_init(); + sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback); //sleep_timer_start(__MS_TO_32K_CNT(g_com_map[COM_INTERVAL]));//测试 sleep_timer_start(__MS_TO_32K_CNT(SLEEP_COUNT));//测试 //board_5V_input_init(voltage_input_handler);//有修改3.3V会一直高电平导致无法进入休眠 -- Gitblit v1.9.3