From 6dd438df17c455d3224e0657caa5e34a91bf4c65 Mon Sep 17 00:00:00 2001 From: Michael Rogger Date: Sun, 18 Aug 2024 20:30:19 +0200 Subject: [PATCH] Cleanup --- include/zb_mem_config_custom.h | 97 ---------------------------------- prj_debug.conf | 14 ----- prj_production.conf | 8 +-- src/main.c | 11 ++-- 4 files changed, 10 insertions(+), 120 deletions(-) delete mode 100644 include/zb_mem_config_custom.h diff --git a/include/zb_mem_config_custom.h b/include/zb_mem_config_custom.h deleted file mode 100644 index 14e0c0f..0000000 --- a/include/zb_mem_config_custom.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * ZBOSS Zigbee 3.0 - * - * Copyright (c) 2012-2020 DSR Corporation, Denver CO, USA. - * www.dsr-zboss.com - * www.dsr-corporation.com - * All rights reserved. - * - * - * Use in source and binary forms, redistribution in binary form only, with - * or without modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 2. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 3. This software, with or without modification, must only be used with a Nordic - * Semiconductor ASA integrated circuit. - * - * 4. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/* PURPOSE: The medium configuration: ZC, medium network size, moderate load, medium complexity -*/ -#ifndef ZB_MEM_CONFIG_MAXIMUM_H -#define ZB_MEM_CONFIG_MAXIMUM_H 1 - -/** - @addtogroup configurable_mem - @{ - @cond skip_this - @{ -*/ -#define ZB_CONFIG_ROLE_ZC -/*#define ZB_CONFIG_ROLE_ZR*/ -/*#define ZB_CONFIG_ROLE_ZED*/ - -/*#define ZB_CONFIG_OVERALL_NETWORK_SIZE 128*/ -#define ZB_CONFIG_OVERALL_NETWORK_SIZE 32U -/*#define ZB_CONFIG_OVERALL_NETWORK_SIZE 16*/ - -/** - @} - @endcond -*/ - -/*#define ZB_CONFIG_HIGH_TRAFFIC*/ -/** - Medium routing and application traffic from/to that device. - */ -#define ZB_CONFIG_MODERATE_TRAFFIC -/*#define ZB_CONFIG_LIGHT_TRAFFIC*/ - -/*#define ZB_CONFIG_APPLICATION_COMPLEX*/ -/** - Medium user's application complexity at that device: medium relations to other devices. - */ -#define ZB_CONFIG_APPLICATION_MODERATE -/*#define ZB_CONFIG_APPLICATION_SIMPLE*/ - -/** - @} -*/ - -/* Now common logic derives numerical parameters from the defined configuration. */ -#include "zb_mem_config_common.h" - -/* Now if you REALLY know what you do, you can study zb_mem_config_common.h and redefine some configuration parameters, like: */ -#undef ZB_CONFIG_SCHEDULER_Q_SIZE -#define ZB_CONFIG_SCHEDULER_Q_SIZE 128 - -/* Increase buffer pool size. */ -#undef ZB_CONFIG_IOBUF_POOL_SIZE -#define ZB_CONFIG_IOBUF_POOL_SIZE 96 - -/* Memory context definitions */ -#include "zb_mem_config_context.h" - -#endif /* ZB_MEM_CONFIG_MAXIMUM_H */ diff --git a/prj_debug.conf b/prj_debug.conf index 19b3b98..415ca69 100644 --- a/prj_debug.conf +++ b/prj_debug.conf @@ -18,7 +18,6 @@ CONFIG_ZIGBEE_APP_UTILS_LOG_LEVEL_DBG=y CONFIG_ZBOSS_TRACE_LOG_LEVEL_DBG=n CONFIG_ZBOSS_OSIF_LOG_LEVEL_DBG=n - CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_MAIN_THREAD_PRIORITY=7 @@ -53,16 +52,3 @@ CONFIG_NET_IPV6=n CONFIG_NET_IP_ADDR_CHECK=n CONFIG_PM_DEVICE=y - -# Thread Analyzer -#CONFIG_THREAD_ANALYZER=y -#CONFIG_THREAD_MONITOR=y -#CONFIG_THREAD_ANALYZER_AUTO=y -#CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=10 -#CONFIG_INIT_STACKS=y -#CONFIG_THREAD_STACK_INFO=y -#CONFIG_THREAD_NAME=y - -# Enable core dump support -CONFIG_DEBUG_COREDUMP=y -CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y \ No newline at end of file diff --git a/prj_production.conf b/prj_production.conf index c78d07a..3ff2589 100644 --- a/prj_production.conf +++ b/prj_production.conf @@ -22,13 +22,13 @@ CONFIG_ZIGBEE_ROLE_END_DEVICE=y CONFIG_ZIGBEE_CHANNEL_SELECTION_MODE_MULTI=y # Sensor +CONFIG_SPI=n +CONFIG_PWM=n +CONFIG_ADC=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_SHTCX=y -CONFIG_SPI=n - -CONFIG_ADC=y -CONFIG_PWM=n +CONFIG_SCD4X=y # This example requires more workqueue stack CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 diff --git a/src/main.c b/src/main.c index 562bec6..a68a7cc 100644 --- a/src/main.c +++ b/src/main.c @@ -799,7 +799,8 @@ int main(void) // RX on when Idle and power_source are required for the ZigBee capability AC mains = False // Turn off radio when sleeping https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/zigbee/configuring.html#sleepy-end-device-behavior - zigbee_configure_sleepy_behavior(true); + zb_set_rx_on_when_idle(ZB_FALSE); + LOG_INF("Enabled sleepy end device behavior."); // https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.2.1/zigbee_prog_principles.html#zigbee_power_optimization_sleepy zb_set_ed_timeout(ED_AGING_TIMEOUT_32MIN); @@ -810,7 +811,9 @@ int main(void) init_clusters_attr(); ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER(SCHNEGGI_ENDPOINT, identify_cb); - zigbee_erase_persistent_storage(ZB_FALSE); + + // Erase persistent storage + zb_set_nvram_erase_at_start(ZB_FALSE); zigbee_enable(); @@ -822,9 +825,7 @@ int main(void) } /* - - -WDT +- WDT - Measure power consumption - README