作为生产的第一个版本

This commit is contained in:
小马_666 2025-01-20 18:55:21 +08:00
parent 4f54d897ed
commit f788a38808
6 changed files with 19 additions and 18 deletions

View File

@ -18,7 +18,7 @@ ALIGN(RT_ALIGN_SIZE)
static char button_thread_stack[BUTTON_THREAD_STACK_SIZE]; static char button_thread_stack[BUTTON_THREAD_STACK_SIZE];
static struct rt_thread button_thread; static struct rt_thread button_thread;
#else #else
static rt_timer_t button_timer; // static rt_timer_t button_timer;
static struct rt_timer button_timer1; static struct rt_timer button_timer1;
#endif // !BUTTON_USE_THREAD #endif // !BUTTON_USE_THREAD

View File

@ -694,6 +694,7 @@ size_t Flash_Get_SysCfg (TeFlashCfgInfoId id)
else else
{ {
rt_memcpy(&iot_upload_cycle[0], (rt_uint8_t *)hr_sys_cfg_info_addr[id], 2); rt_memcpy(&iot_upload_cycle[0], (rt_uint8_t *)hr_sys_cfg_info_addr[id], 2);
rt_thread_mdelay(10);
iot_upload = ((iot_upload_cycle[0] << 8) + iot_upload_cycle[1]); iot_upload = ((iot_upload_cycle[0] << 8) + iot_upload_cycle[1]);
LOG_D ("iot_upload: %d", iot_upload); LOG_D ("iot_upload: %d", iot_upload);
return iot_upload; return iot_upload;
@ -766,7 +767,7 @@ int BSP_Flash_Init (void)
{ {
rt_uint16_t flag_value = *(rt_uint16_t *)FLASH_INIT_FLAG_ADDR; rt_uint16_t flag_value = *(rt_uint16_t *)FLASH_INIT_FLAG_ADDR;
rt_thread_mdelay(100); rt_thread_mdelay(50);
LOG_D("flag_value = %X", flag_value); LOG_D("flag_value = %X", flag_value);
if (flag_value != FLASH_FIRST_INIT_VALUE) if (flag_value != FLASH_FIRST_INIT_VALUE)
{ {

View File

@ -34,7 +34,7 @@ static rt_uint8_t uart4_rx_rb_data[UART4_RX_RB_LENGTH];
static rt_sem_t uart4_rx_ok_sem; static rt_sem_t uart4_rx_ok_sem;
static rt_timer_t uart4_rx_timer; // static rt_timer_t uart4_rx_timer;
static struct rt_timer uart4_rx_timer1; static struct rt_timer uart4_rx_timer1;
uint8_t sensor_rx_count = 0; // 接收缓冲区中,已经收到的数据包数量 uint8_t sensor_rx_count = 0; // 接收缓冲区中,已经收到的数据包数量

View File

@ -37,15 +37,16 @@ static rt_uint8_t uart5_tx_rb_data[UART5_TX_RB_LENGTH];
static rt_sem_t uart5_rx_ok_sem; static rt_sem_t uart5_rx_ok_sem;
static rt_timer_t uart5_timer; // static rt_timer_t uart5_timer;
static rt_timer_t uart5_timer1; struct rt_timer uart5_timer1;
uint8_t hr_rx_flag = 0; // 接收缓冲区中,已经收到的数据包数量 uint8_t hr_rx_flag = 0; // 接收缓冲区中,已经收到的数据包数量
void uart5_timeout(void *parameter) void uart5_timeout(void *parameter)
{ {
rt_sem_release(uart5_rx_ok_sem); rt_sem_release(uart5_rx_ok_sem);
// rt_timer_stop(uart5_timer); // rt_timer_stop(uart5_timer);
rt_timer_stop(uart5_timer1); rt_timer_stop(&uart5_timer1);
hr_rx_flag = 0; hr_rx_flag = 0;
} }
@ -601,13 +602,13 @@ int BSP_HR_Init(void)
LOG_E("uart5_rx_ok_sem create failed"); LOG_E("uart5_rx_ok_sem create failed");
} }
rt_timer_init(uart5_timer1, "uart5_timeout", uart5_timeout, RT_NULL, 50, RT_TIMER_FLAG_PERIODIC); rt_timer_init(&uart5_timer1, "uart5_timeout", uart5_timeout, RT_NULL, 50, RT_TIMER_FLAG_PERIODIC);
uart5_timer = rt_timer_create("uart5_timeout", uart5_timeout, RT_NULL, 50, RT_TIMER_FLAG_PERIODIC); // uart5_timer = rt_timer_create("uart5_timeout", uart5_timeout, RT_NULL, 50, RT_TIMER_FLAG_PERIODIC);
if (uart5_timer == RT_NULL) // if (uart5_timer == RT_NULL)
{ // {
LOG_E("uart5_timer create failed"); // LOG_E("uart5_timer create failed");
} // }
rt_err_t ret = rt_thread_init(&hr_thread, rt_err_t ret = rt_thread_init(&hr_thread,
"hr_thread", "hr_thread",
@ -644,7 +645,7 @@ void UART5_IRQHandler(void)
lwrb_write(&uart5_rx_rb, &data, 1); lwrb_write(&uart5_rx_rb, &data, 1);
if (hr_rx_flag == 0) if (hr_rx_flag == 0)
{ {
rt_timer_start(uart5_timer); rt_timer_start(&uart5_timer1);
hr_rx_flag = 1; hr_rx_flag = 1;
} }
} }

View File

@ -1614,9 +1614,8 @@ int BSP_Nt26k_Thread_Init(void)
nt26k_timer = rt_timer_create("heartbeat", nt26k_timer = rt_timer_create("heartbeat",
Nt26k_Ht_Timer_Cb, // 回调函数 Nt26k_Ht_Timer_Cb, // 回调函数
RT_NULL, // 参数 RT_NULL, // 参数
timeout, // 定时周期120分钟) (rt_uint32_t)timeout, // 定时周期(单位:分钟)
RT_TIMER_FLAG_PERIODIC); // 周期性定时器 RT_TIMER_FLAG_PERIODIC); // 周期性定时器
if (nt26k_timer == RT_NULL) if (nt26k_timer == RT_NULL)
{ {
rt_kprintf("创建定时器失败\n"); rt_kprintf("创建定时器失败\n");

View File

@ -15,8 +15,8 @@
/*使用动态日志及密码功能时,需开启宏 FINSH_USING_AUTH ULOG_USING_FILTER ENABLE_LOG_ALL ULOG_OUTPUT_LVL = 7 以及设置ulog.c 1522行 输出等级为0*/ /*使用动态日志及密码功能时,需开启宏 FINSH_USING_AUTH ULOG_USING_FILTER ENABLE_LOG_ALL ULOG_OUTPUT_LVL = 7 以及设置ulog.c 1522行 输出等级为0*/
/**/ /**/
#define FINSH_USING_AUTH //开启终端密码登录功能 // #define FINSH_USING_AUTH //开启终端密码登录功能
#define ULOG_USING_FILTER //开启动态修改日志等级 默认修改在ulog.c 1522行 // #define ULOG_USING_FILTER //开启动态修改日志等级 默认修改在ulog.c 1522行
#define ENABLE_LOG_ALL #define ENABLE_LOG_ALL
#define TEST_ENABLE //打开所有的终端测试程序 #define TEST_ENABLE //打开所有的终端测试程序