Skip to content

Commit

Permalink
sync code with samples in latest SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Oct 12, 2023
1 parent 7cca065 commit 3fc45e8
Show file tree
Hide file tree
Showing 15 changed files with 277 additions and 154 deletions.
14 changes: 7 additions & 7 deletions src/app_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ extern "C" {
#define BOARD_8258_DONGLE 5
#define BOARD_8278_EVK 6
#define BOARD_8278_DONGLE 7
#define BOARD_9518_EVK 8
#define BOARD_9518_DONGLE 9
#define BOARD_B91_EVK 8
#define BOARD_B91_DONGLE 9
#define BOARD_8258_03MMC 10

/* Board define */
Expand All @@ -84,7 +84,7 @@ extern "C" {
#define CLOCK_SYS_CLOCK_HZ 48000000
#elif defined(MCU_CORE_B91)
#define FLASH_CAP_SIZE_1M 1
#define BOARD BOARD_9518_DONGLE//BOARD_9518_EVK
#define BOARD BOARD_B91_DONGLE//BOARD_B91_EVK
#define CLOCK_SYS_CLOCK_HZ 48000000
#else
#error "MCU is undefined!"
Expand All @@ -109,10 +109,10 @@ extern "C" {
#include "board_8278_evk.h"
#elif (BOARD == BOARD_8278_DONGLE)
#include "board_8278_dongle.h"
#elif (BOARD == BOARD_9518_EVK)
#include "board_9518_evk.h"
#elif (BOARD == BOARD_9518_DONGLE)
#include "board_9518_dongle.h"
#elif (BOARD == BOARD_B91_EVK)
#include "board_b91_evk.h"
#elif (BOARD == BOARD_B91_DONGLE)
#include "board_b91_dongle.h"
#endif


Expand Down
4 changes: 3 additions & 1 deletion src/common/comm_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -66,7 +68,7 @@
#define TLSR_8258_512K 0x02
#define TLSR_8258_1M 0x03
#define TLSR_8278 0x04
#define TLSR_9518 0x05
#define TLSR_B91 0x05

/* Image types */
#if (BOOT_LOADER_MODE)
Expand Down
2 changes: 2 additions & 0 deletions src/common/factory_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#include "tl_common.h"
Expand Down
2 changes: 2 additions & 0 deletions src/common/factory_reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#ifndef FACTORY_RESET_H
Expand Down
2 changes: 2 additions & 0 deletions src/common/firmwareEncryptChk.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#include "tl_common.h"
Expand Down
2 changes: 2 additions & 0 deletions src/common/firmwareEncryptChk.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#ifndef _FIRMWARE_ENCRYPT_CHECK_H_
Expand Down
12 changes: 5 additions & 7 deletions src/common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @date 2021
*
* @par Copyright (c) 2021, Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************************************/

#include "zb_common.h"
Expand All @@ -30,13 +32,9 @@ extern void user_init(bool isRetention);
* main:
* */
int main(void){
u8 isRetention = drv_platform_init();
startup_state_e state = drv_platform_init();

#if VOLTAGE_DETECT_ENABLE
if(!isRetention){
voltage_detect();
}
#endif
u8 isRetention = (state == SYSTEM_DEEP_RETENTION) ? 1 : 0;

os_init(isRetention);

Expand All @@ -61,7 +59,7 @@ int main(void){
while(1){
#if VOLTAGE_DETECT_ENABLE
if(clock_time_exceed(tick, 200 * 1000)){
voltage_detect();
voltage_detect(0);
tick = clock_time();
}
#endif
Expand Down
Loading

0 comments on commit 3fc45e8

Please sign in to comment.