加了动态日志和密码功能
This commit is contained in:
parent
f112683ebf
commit
df52397e5b
|
@ -2,7 +2,7 @@
|
|||
* @Author: mbw
|
||||
* @Date: 2024-10-23 17:14:16
|
||||
* @LastEditors: mbw && 1600520629@qq.com
|
||||
* @LastEditTime: 2025-01-10 13:37:28
|
||||
* @LastEditTime: 2025-01-15 10:36:40
|
||||
* @FilePath: \JT-DT-YD4N02A_RTT_MRS-NT26K\applications\main.c
|
||||
* @Descrt_thread_
|
||||
*
|
||||
|
@ -198,18 +198,10 @@ int main (void)
|
|||
{
|
||||
SYS_EventInit();
|
||||
BSP_SYS_Init();
|
||||
// 读取历史记录总数
|
||||
Flash_GetTotalRecord (&TotalRecords);
|
||||
|
||||
work_duration = Flash_Get_WorkDuration();
|
||||
LOG_D ("工作天数:%d", work_duration);
|
||||
rt_timer_init (&work_cnt_timer,
|
||||
"work_cnt_timer",
|
||||
Work_Cnt_Timer_Callback,
|
||||
RT_NULL,
|
||||
WORK_TIMER_CNT,
|
||||
RT_TIMER_FLAG_PERIODIC);
|
||||
rt_timer_start (&work_cnt_timer);
|
||||
|
||||
TuFlashProductTimeLimitFrame LimitTime;
|
||||
if (Flash_GetProductTimeLimit (&LimitTime, kExpirationTimeId) == READY)
|
||||
{
|
||||
|
@ -221,21 +213,18 @@ int main (void)
|
|||
LimitTime.Struct.year, LimitTime.Struct.month, LimitTime.Struct.day,
|
||||
LimitTime.Struct.hour, LimitTime.Struct.minute, LimitTime.Struct.second);
|
||||
}
|
||||
|
||||
if (Flash_GetNum_Records (kRecordSensoEndOfLife) == 1)
|
||||
{
|
||||
LOG_W ("寿命已到期");
|
||||
H308.end_of_life = 1;
|
||||
}
|
||||
// 寿命到期检测
|
||||
if (IS_H308_EndOfLife())
|
||||
{
|
||||
if (Flash_GetNum_Records (kRecordSensoEndOfLife) == 0)
|
||||
{
|
||||
Flash_Write_Record (kRecordSensoEndOfLife);
|
||||
}
|
||||
Send_Laser_Alarm_Event (kSensorFailureEvent);
|
||||
}
|
||||
rt_timer_init (&work_cnt_timer,
|
||||
"work_cnt_timer",
|
||||
Work_Cnt_Timer_Callback,
|
||||
RT_NULL,
|
||||
WORK_TIMER_CNT,
|
||||
RT_TIMER_FLAG_PERIODIC);
|
||||
rt_timer_start (&work_cnt_timer);
|
||||
// 检测上电/掉电复位标志
|
||||
if (RCC_GetFlagStatus (RCC_FLAG_PORRST) != RESET) // TODO:这块超级电容会造成掉电重启,并且标志是上电复位,只能通过其超级电容造成复位时事件创建失败进行判断,不治本
|
||||
{
|
||||
|
|
|
@ -163,7 +163,7 @@ float Get_ADC_Voltage(TeAdcIndex index)
|
|||
#ifdef TEST_ENABLE
|
||||
|
||||
// 这里测的是原始的ADC电压,没有经过缩放
|
||||
static int TEST_Get_ADC_Voltage(int argc, char **argv)
|
||||
int TEST_Get_ADC_Voltage(int argc, char **argv)
|
||||
{
|
||||
if (argc == 2)
|
||||
{
|
||||
|
|
|
@ -55,6 +55,20 @@ static void BSP_Led_thread_entry(void *param)
|
|||
LED_G_INTERNET;
|
||||
}
|
||||
}
|
||||
else if (SysControl.status == KMuteEvent)
|
||||
{
|
||||
if (SysControl.last_status == kNormalDetectionEvents)
|
||||
{
|
||||
if ((nt26k_conncet_tcp_flag))
|
||||
{
|
||||
LED_G_NORMAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LED_G_INTERNET;
|
||||
}
|
||||
}
|
||||
}
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1519,8 +1519,8 @@ int ulog_init(void)
|
|||
#endif /* ULOG_USING_ASYNC_OUTPUT */
|
||||
|
||||
#ifdef ULOG_USING_FILTER
|
||||
ulog_global_filter_lvl_set(LOG_FILTER_LVL_ALL);
|
||||
// ulog_global_filter_lvl_set(LOG_FILTER_LVL_SILENT);
|
||||
// ulog_global_filter_lvl_set(LOG_FILTER_LVL_ALL);
|
||||
ulog_global_filter_lvl_set(LOG_FILTER_LVL_SILENT);
|
||||
#endif
|
||||
|
||||
ulog.init_ok = RT_TRUE;
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
|
||||
/* Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) */
|
||||
|
||||
// #define FINSH_USING_AUTH //开启终端密码登录功能
|
||||
/*使用动态日志及密码功能时,需开启宏 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 ENABLE_LOG_ALL
|
||||
|
@ -154,7 +156,7 @@
|
|||
#define AT_USING_CLIENT
|
||||
#define AT_CLIENT_NUM_MAX 1
|
||||
|
||||
#ifdef ENABLE_LOG_ALL
|
||||
#ifdef TEST_ENABLE
|
||||
#define AT_USING_CLI
|
||||
#define AT_PRINT_RAW_CMD
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue