Skip to content

Commit 05f54f9

Browse files
committed
[Telink] Adopt TL3218 to latest Zephyr version
1 parent 44b20d6 commit 05f54f9

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

.github/workflows/examples-telink.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ jobs:
187187
- name: clean out build output (keep tools)
188188
run: rm -rf ./out/telink*
189189

190-
- name: Build example Telink (tl321x) Lighting App with OTA (LZMA), Shell, Factory Data
190+
- name: Build example Telink (TL3218) Lighting App with OTA (LZMA), Shell, Factory Data
191191
# Run test for master and all PRs
192192
run: |
193193
./scripts/run_in_build_env.sh \
194-
"./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-compress-lzma-shell-factory-data' build"
194+
"./scripts/build/build_examples.py --target 'telink-tl3218-light-ota-compress-lzma-shell-factory-data' build"
195195
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
196-
telink tl3218x light-app-ota-compress-lzma-shell-factory-data \
197-
out/telink-tl3218x-light-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \
196+
telink tl3218 light-app-ota-compress-lzma-shell-factory-data \
197+
out/telink-tl3218-light-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \
198198
/tmp/bloat_reports/
199199
200200
- name: clean out build output (keep tools)

config/telink/chip-module/Kconfig.defaults

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ endif
235235

236236
# Board non-retention config
237237
if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1 || \
238-
BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D || BOARD_TL3218X
238+
BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D || BOARD_TL3218
239239
config PWM
240240
default y
241241
endif

scripts/build/build/targets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def BuildTelinkTarget():
770770
TargetPart('tlsr9528a_retention', board=TelinkBoard.TLSR9528A_RETENTION),
771771
TargetPart('tlsr9258a', board=TelinkBoard.TLSR9258A),
772772
TargetPart('tlsr9258a_retention', board=TelinkBoard.TLSR9258A_RETENTION),
773-
TargetPart('tl3218x', board=TelinkBoard.TL3218X),
773+
TargetPart('tl3218', board=TelinkBoard.TL3218),
774774
])
775775

776776
target.AppendFixedTargets([

scripts/build/builders/telink.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class TelinkBoard(Enum):
121121
TLSR9528A_RETENTION = auto()
122122
TLSR9258A = auto()
123123
TLSR9258A_RETENTION = auto()
124-
TL3218X = auto()
124+
TL3218 = auto()
125125

126126
def GnArgName(self):
127127
if self == TelinkBoard.TLRS9118BDK40D:
@@ -136,8 +136,8 @@ def GnArgName(self):
136136
return 'tlsr9258a'
137137
elif self == TelinkBoard.TLSR9258A_RETENTION:
138138
return 'tlsr9258a_retention'
139-
elif self == TelinkBoard.TL3218X:
140-
return 'tl3218x'
139+
elif self == TelinkBoard.TL3218:
140+
return 'tl3218'
141141
else:
142142
raise Exception('Unknown board type: %r' % self)
143143

scripts/build/testdata/all_targets_linux_x64.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ nuttx-x64-light
2222
qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage]
2323
stm32-stm32wb5mm-dk-light
2424
tizen-arm-{all-clusters,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-coverage][-with-ui]
25-
telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention,tl3218x}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-compress-lzma][-thread-analyzer]
25+
telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention,tl3218}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-compress-lzma][-thread-analyzer]
2626
openiotsdk-{shell,lock}[-mbedtls][-psa]

src/platform/telink/BLEManagerImpl.cpp

+11-10
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@
4646
#include <zephyr/sys/util.h>
4747

4848
extern "C" {
49-
50-
#ifdef CONFIG_BT_B9X
51-
49+
#if defined(CONFIG_BT_B9X)
5250
extern __attribute__((noinline)) int b9x_bt_blc_mac_init(uint8_t * bt_mac);
53-
/**
54-
* @brief bt mac initialization
55-
*/
56-
__attribute__((noinline)) void telink_bt_blc_mac_init(uint8_t * bt_mac)
57-
{
58-
b9x_bt_blc_mac_init(bt_mac);
59-
}
51+
#elif defined(CONFIG_BT_TLX)
52+
extern __attribute__((noinline)) int tlx_bt_blc_mac_init(uint8_t * bt_mac);
53+
#elif defined(CONFIG_BT_W91)
54+
extern __attribute__((noinline)) void telink_bt_blc_mac_init(uint8_t * bt_mac);
6055
#endif
6156
}
6257

@@ -128,7 +123,13 @@ CHIP_ERROR InitBLEMACAddress()
128123
int error = 0;
129124
bt_addr_le_t addr;
130125

126+
#if defined(CONFIG_BT_B9X)
127+
b9x_bt_blc_mac_init(addr.a.val);
128+
#elif defined(CONFIG_BT_TLX)
129+
tlx_bt_blc_mac_init(addr.a.val);
130+
#elif defined(CONFIG_BT_W91)
131131
telink_bt_blc_mac_init(addr.a.val);
132+
#endif
132133

133134
if (BT_ADDR_IS_STATIC(&addr.a)) // in case of Random static address, create a new id
134135
{
File renamed without changes.

0 commit comments

Comments
 (0)