作为生产的第一个版本
This commit is contained in:
parent
4f54d897ed
commit
f788a38808
|
@ -18,7 +18,7 @@ ALIGN(RT_ALIGN_SIZE)
|
|||
static char button_thread_stack[BUTTON_THREAD_STACK_SIZE];
|
||||
static struct rt_thread button_thread;
|
||||
#else
|
||||
static rt_timer_t button_timer;
|
||||
// static rt_timer_t button_timer;
|
||||
static struct rt_timer button_timer1;
|
||||
#endif // !BUTTON_USE_THREAD
|
||||
|
||||
|
|
|
@ -693,7 +693,8 @@ size_t Flash_Get_SysCfg (TeFlashCfgInfoId id)
|
|||
}
|
||||
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]);
|
||||
LOG_D ("iot_upload: %d", 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_thread_mdelay(100);
|
||||
rt_thread_mdelay(50);
|
||||
LOG_D("flag_value = %X", flag_value);
|
||||
if (flag_value != FLASH_FIRST_INIT_VALUE)
|
||||
{
|
||||
|
|
|
@ -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_timer_t uart4_rx_timer;
|
||||
// static rt_timer_t uart4_rx_timer;
|
||||
static struct rt_timer uart4_rx_timer1;
|
||||
|
||||
uint8_t sensor_rx_count = 0; // 接收缓冲区中,已经收到的数据包数量
|
||||
|
|
|
@ -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_timer_t uart5_timer;
|
||||
static rt_timer_t uart5_timer1;
|
||||
// static rt_timer_t uart5_timer;
|
||||
struct rt_timer uart5_timer1;
|
||||
|
||||
|
||||
uint8_t hr_rx_flag = 0; // 接收缓冲区中,已经收到的数据包数量
|
||||
void uart5_timeout(void *parameter)
|
||||
{
|
||||
rt_sem_release(uart5_rx_ok_sem);
|
||||
// rt_timer_stop(uart5_timer);
|
||||
rt_timer_stop(uart5_timer1);
|
||||
rt_timer_stop(&uart5_timer1);
|
||||
hr_rx_flag = 0;
|
||||
}
|
||||
|
||||
|
@ -601,13 +602,13 @@ int BSP_HR_Init(void)
|
|||
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);
|
||||
if (uart5_timer == RT_NULL)
|
||||
{
|
||||
LOG_E("uart5_timer create failed");
|
||||
}
|
||||
// uart5_timer = rt_timer_create("uart5_timeout", uart5_timeout, RT_NULL, 50, RT_TIMER_FLAG_PERIODIC);
|
||||
// if (uart5_timer == RT_NULL)
|
||||
// {
|
||||
// LOG_E("uart5_timer create failed");
|
||||
// }
|
||||
|
||||
rt_err_t ret = rt_thread_init(&hr_thread,
|
||||
"hr_thread",
|
||||
|
@ -644,7 +645,7 @@ void UART5_IRQHandler(void)
|
|||
lwrb_write(&uart5_rx_rb, &data, 1);
|
||||
if (hr_rx_flag == 0)
|
||||
{
|
||||
rt_timer_start(uart5_timer);
|
||||
rt_timer_start(&uart5_timer1);
|
||||
hr_rx_flag = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1614,9 +1614,8 @@ int BSP_Nt26k_Thread_Init(void)
|
|||
nt26k_timer = rt_timer_create("heartbeat",
|
||||
Nt26k_Ht_Timer_Cb, // 回调函数
|
||||
RT_NULL, // 参数
|
||||
timeout, // 定时周期(120分钟)
|
||||
(rt_uint32_t)timeout, // 定时周期(单位:分钟)
|
||||
RT_TIMER_FLAG_PERIODIC); // 周期性定时器
|
||||
|
||||
if (nt26k_timer == RT_NULL)
|
||||
{
|
||||
rt_kprintf("创建定时器失败\n");
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
/*使用动态日志及密码功能时,需开启宏 FINSH_USING_AUTH ULOG_USING_FILTER ENABLE_LOG_ALL ULOG_OUTPUT_LVL = 7 以及设置ulog.c 1522行 输出等级为0*/
|
||||
/**/
|
||||
#define FINSH_USING_AUTH //开启终端密码登录功能
|
||||
#define ULOG_USING_FILTER //开启动态修改日志等级 默认修改在ulog.c 1522行
|
||||
// #define FINSH_USING_AUTH //开启终端密码登录功能
|
||||
// #define ULOG_USING_FILTER //开启动态修改日志等级 默认修改在ulog.c 1522行
|
||||
|
||||
#define ENABLE_LOG_ALL
|
||||
#define TEST_ENABLE //打开所有的终端测试程序
|
||||
|
|
Loading…
Reference in New Issue