mirror of
https://github.com/HEYAHONG/Air780EDemo.git
synced 2025-05-08 10:14:11 +08:00
完善Kconfig设置
This commit is contained in:
parent
6bd2b9c86d
commit
565548819b
26
Kconfig.h
26
Kconfig.h
@ -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__
|
||||
|
24
app/Kconfig
24
app/Kconfig
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user