From e93ee63b71fc1892e233c3ee091267c801e4b9bc Mon Sep 17 00:00:00 2001 From: Eugene Sylenko <1863154+ffenix113@users.noreply.github.com> Date: Thu, 23 May 2024 08:56:55 +0200 Subject: [PATCH] fix: do not halt on error if not debugging Previously on any issue device would hang, as if in development. Now - it will hang only if debug mode is selected. --- templates/extenders/debug_log.go | 7 +++++++ types/appconfig/appconfig.go | 4 ---- types/appconfig/known.go | 10 +--------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/templates/extenders/debug_log.go b/templates/extenders/debug_log.go index 74f63e0..b3f7903 100644 --- a/templates/extenders/debug_log.go +++ b/templates/extenders/debug_log.go @@ -59,6 +59,13 @@ func NewDebugUARTLog(config DebugConfig) generator.Extender { appconfig.CONFIG_UART_LINE_CTRL.Required(appconfig.Yes), appconfig.CONFIG_PRINTK.Required(appconfig.Yes), + appconfig.NewValue("CONFIG_ZBOSS_HALT_ON_ASSERT").Default(appconfig.Yes), + appconfig.NewValue("CONFIG_RESET_ON_FATAL_ERROR").Default(appconfig.No), + appconfig.NewValue("CONFIG_DEBUG_OPTIMIZATIONS").Default(appconfig.Yes), + appconfig.NewValue("CONFIG_DEBUG_THREAD_INFO").Default(appconfig.Yes), + // appconfig.NewValue("CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE").Default(`2048`), + // appconfig.NewValue("CONFIG_HEAP_MEM_POOL_SIZE").Default(`2048`), + // ZBHome Debug enable appconfig.NewValue("CONFIG_ZBHOME_DEBUG_ENABLE").Required(appconfig.Yes), diff --git a/types/appconfig/appconfig.go b/types/appconfig/appconfig.go index db8a058..bc9d0ad 100644 --- a/types/appconfig/appconfig.go +++ b/types/appconfig/appconfig.go @@ -104,10 +104,6 @@ func NewDefaultAppConfig(opts DefaultAppConfigOptions) (*AppConfig, error) { CONFIG_NET_IPV6, CONFIG_NET_IP_ADDR_CHECK, CONFIG_NET_UDP, - CONFIG_ZBOSS_HALT_ON_ASSERT, - CONFIG_RESET_ON_FATAL_ERROR, - CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE, - CONFIG_HEAP_MEM_POOL_SIZE, CONFIG_CONSOLE, CONFIG_USB_DEVICE_STACK, ) diff --git a/types/appconfig/known.go b/types/appconfig/known.go index c97a1af..600c1cb 100644 --- a/types/appconfig/known.go +++ b/types/appconfig/known.go @@ -48,15 +48,7 @@ var ( CONFIG_NET_UDP = NewValue("CONFIG_NET_UDP").Default(No) // Sensors - CONFIG_DHT = NewValue("CONFIG_DHT").Default(Yes) - - // Debug - CONFIG_ZBOSS_HALT_ON_ASSERT = NewValue("CONFIG_ZBOSS_HALT_ON_ASSERT").Default(Yes) - CONFIG_RESET_ON_FATAL_ERROR = NewValue("CONFIG_RESET_ON_FATAL_ERROR").Default(No) - CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE = NewValue("CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE").Default(`2048`) - CONFIG_HEAP_MEM_POOL_SIZE = NewValue("CONFIG_HEAP_MEM_POOL_SIZE").Default(`2048`) - CONFIG_DEBUG_OPTIMIZATIONS = NewValue("CONFIG_DEBUG_OPTIMIZATIONS").Default(No) - CONFIG_DEBUG_THREAD_INFO = NewValue("CONFIG_DEBUG_THREAD_INFO").Default(No) + CONFIG_DHT = NewValue("CONFIG_DHT").Default(Yes) ) const (