Skip to content

Commit d8bda15

Browse files
committed
Do not resert device configuration on zigbee network leave
1 parent a6cb2b5 commit d8bda15

5 files changed

Lines changed: 27 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PROJECT_NAME = tlc_switch
22

33
BOARD ?= TS0012
4-
VERSION := 20
4+
VERSION := 21
55

66
DEBUG ?= 0
77

docs/changelog_fw.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
### 1.0.20:
44

5+
- Do not reset device configuration on Zigbee network leave.
6+
7+
### 1.0.20:
8+
59
- Fix bug when changing device config string crashed 3 and 4 gang devices. Due to this change, device settings may reset after OTA update.
610
- Fix bug when detached mode doesn't work for Toggle switches.
711

makefiles/proj.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ $(BUILD_PATH)/proj/os/ev_timer.o
3030
#$(BUILD_PATH)/proj/drivers/drv_hw.o \
3131
#$(BUILD_PATH)/proj/drivers/drv_flash.o \
3232
33+
$(BUILD_PATH)/proj/drivers/drv_nv.o: GCC_FLAGS += -Dnv_resetToFactoryNew=nv_resetToFactoryNew__sdk
34+
3335
# Each subdirectory must supply rules for building sources it contributes
3436
$(BUILD_PATH)/proj/%.o: $(SDK_PATH)/proj/%.c
3537
@echo 'Building file: $<'
36-
@$(CC) $(GCC_FLAGS) $(INCLUDE_PATHS) -c -o"$@" "$<"
38+
$(CC) $(GCC_FLAGS) $(INCLUDE_PATHS) -c -o"$@" "$<"

makefiles/src.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ $(BUILD_PATH)/$(SRC_DIR)/patch_sdk/cstartup_8258.o \
2020
$(BUILD_PATH)/$(SRC_DIR)/patch_sdk/hw_drv.o \
2121
$(BUILD_PATH)/$(SRC_DIR)/patch_sdk/adc_drv.o \
2222
$(BUILD_PATH)/$(SRC_DIR)/patch_sdk/random.o \
23+
$(BUILD_PATH)/$(SRC_DIR)/patch_sdk/drv_nv.o \
2324
$(BUILD_PATH)/$(SRC_DIR)/zigbee/general_commands.o \
2425
$(BUILD_PATH)/$(SRC_DIR)/zigbee/basic_cluster.o \
2526
$(BUILD_PATH)/$(SRC_DIR)/zigbee/group_cluster.o \

src/patch_sdk/drv_nv.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
#include "tl_common.h"
3+
4+
nv_sts_t nv_resetToFactoryNew(void){
5+
#if NV_ENABLE
6+
if(!nv_facrotyNewRstFlagCheck()){
7+
nv_facrotyNewRstFlagSet();
8+
}
9+
10+
foreach(i, NV_MAX_MODULS){
11+
if(i != NV_MODULE_NWK_FRAME_COUNT && i != NV_MODULE_APP){
12+
nv_resetModule(i);
13+
}
14+
}
15+
16+
nv_facrotyNewRstFlagClear();
17+
#endif
18+
}

0 commit comments

Comments
 (0)