完善Kconfig设置

This commit is contained in:
HEYAHONG 2023-12-28 09:36:39 +08:00
parent 6bd2b9c86d
commit 565548819b
No known key found for this signature in database
GPG Key ID: 45495019025D566D
5 changed files with 53 additions and 3 deletions

View File

@ -18,6 +18,14 @@
#define CONFIG_UART_APP_DEBUG 1
#endif // CONFIG_UART_APP_DEBUG
#ifndef CONFIG_WATCHDOG_TIMEOUT
#define CONFIG_WATCHDOG_TIMEOUT 5
#endif // CONFIG_WATCHDOG_TIMEOUT
#ifndef CONFIG_MOBILE_WATCHDOG_TIMEOUT
#define CONFIG_MOBILE_WATCHDOG_TIMEOUT 120
#endif // CONFIG_MOBILE_WATCHDOG_TIMEOUT
//#define CONFIG_MOBILE_INTERNET_DETECT 1
#if CONFIG_MOBILE_INTERNET_DETECT
@ -28,6 +36,24 @@
#endif // CONFIG_MOBILE_INTERNET_DETECT
#ifndef CONFIG_MQTT_WATCHDOG_TIMEOUT
#define CONFIG_MQTT_WATCHDOG_TIMEOUT 300
#endif // CONFIG_MQTT_WATCHDOG_TIMEOUT
//#define CONFIG_MQTT_STACK_HELLO 1
#if CONFIG_MQTT_STACK_HELLO
#ifndef CONFIG_MQTT_STACK_HELLO_HOST
#define CONFIG_MQTT_STACK_HELLO_HOST "lbsmqtt.airm2m.com"
#endif // CONFIG_MQTT_STACK_HELLO_HOST
#ifndef CONFIG_MQTT_STACK_HELLO_PORT
#define CONFIG_MQTT_STACK_HELLO_PORT 1884
#endif // CONFIG_MQTT_STACK_HELLO_PORT
#endif // CONFIG_MQTT_STACK_HELLO
#endif // USE_KCONFIG
#endif // __KCONFIG_H_INCLUDED__

View File

@ -1,10 +1,28 @@
menu "log"
config UART_APP_DEBUG
bool "uart app debug(uart0)"
default y
endmenu
menu "watchdog"
config WATCHDOG_TIMEOUT
int "watchdog timeout(s)"
default 5
range 1 60
endmenu
menu "mobile"
config MOBILE_WATCHDOG_TIMEOUT
int "mobile watchdog timeout(s)"
default 120
range 30 6000000
config MOBILE_INTERNET_DETECT
bool "mobile internet detect"
default y
@ -21,6 +39,12 @@ endmenu
menu "MQTT"
config MQTT_WATCHDOG_TIMEOUT
int "mqtt watchdog timeout(s)"
default 300
range 30 6000000
choice MQTT_STACK
bool "Choose MQTT Stack"
default MQTT_STACK_HELLO

View File

@ -321,7 +321,7 @@ void mobile::run()
if(info!=NULL && info->usr !=NULL)
{
uint32_t loop_start_tick=*(uint32_t *)info->usr;
if(main_task_gettick_ms()-loop_start_tick > 120000)//检查是否超时
if(main_task_gettick_ms()-loop_start_tick > (CONFIG_MOBILE_WATCHDOG_TIMEOUT * 1000))//检查是否超时
{
main_debug_print("mobile watchdog reset!\r\n");
return false;

View File

@ -100,7 +100,7 @@ void mqttmanager::run()
if(info!=NULL && info->usr !=NULL)
{
uint32_t loop_start_tick=*(uint32_t *)info->usr;
if(main_task_gettick_ms()-loop_start_tick > 300000)//检查是否超时
if(main_task_gettick_ms()-loop_start_tick > (CONFIG_MQTT_WATCHDOG_TIMEOUT * 1000))//检查是否超时
{
main_debug_print("mqttmanager watchdog reset!\r\n");
return false;

View File

@ -58,7 +58,7 @@ static void main_init_in_task(void*usr,heventloop_t*loop)
(void)usr;
(void)loop;
main_debug_print("init watchdog!\r\n");
luat_wdt_set_timeout(3);
luat_wdt_set_timeout(CONFIG_WATCHDOG_TIMEOUT);
}
static void watchdog_init(void)