Skip to content

Commit 3b98e8f

Browse files
telink: hal: drivers: ble: fix the operation of ble during pm
Using the manual mode of the system timer. Signed-off-by: Serhii Salamakha <serhii.salamakha@gmail.com>
1 parent 05269b7 commit 3b98e8f

File tree

9 files changed

+32
-47
lines changed

9 files changed

+32
-47
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
**/blobs/liblt_9518_zephyr.a
1+
**/blobs

tlsr9/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ zephyr_library_sources_ifdef(CONFIG_USB_TELINK_B9X drivers/${SOC}/usbhw.c)
6666

6767
#PM driver dependency
6868
zephyr_library_sources_ifdef(CONFIG_PM drivers/${SOC}/stimer.c)
69-
zephyr_library_sources_ifdef(CONFIG_PM common/${SOC}/sleep.c)
69+
zephyr_library_sources_ifdef(CONFIG_PM common/sleep.c)
7070

7171
# BLE reference sources
7272
if (CONFIG_BT_B9X)
@@ -89,8 +89,8 @@ zephyr_library_sources(
8989
endif() # CONFIG_BT_B9X
9090

9191
# Retention feature
92-
if (CONFIG_BOARD_TLSR9518ADK80D_RETENTION)
92+
if (CONFIG_BOARD_TLSR9518ADK80D_RETENTION OR CONFIG_BOARD_TLSR9528A_RETENTION)
9393

9494
zephyr_library_sources(common/b9x_context.S)
9595

96-
endif() # CONFIG_BOARD_TLSR9518ADK80D_RETENTION
96+
endif() # CONFIG_BOARD_TLSR9518ADK80D_RETENTION OR CONFIG_BOARD_TLSR9528A_RETENTION

tlsr9/ble/stack/ble/B92/controller/os_sup.h

+5
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ void blc_setOsSupEnable(bool en);
2929
bool blc_isOsSupEnable(void);
3030
bool blc_isBleSchedulerBusy(void);
3131
void blc_ll_registerGiveSemCb(os_give_sem_t give_sem_from_isr, os_give_sem_t give_sem);
32+
extern int blc_pm_handler(void);
33+
extern void blc_pm_setAppWakeupLowPower(u32 wakeup_tick, u8 enable);
34+
35+
/* Stack API. !!! user can't use. */
36+
extern void blt_ll_sem_give(void);
3237

3338
#endif /* OS_SUP_H_ */

tlsr9/common/B92/sleep.c

-33
This file was deleted.

tlsr9/common/b9x_sleep.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#define __B9X_SLEEP_H
3232

3333
bool b9x_suspend(uint32_t wake_stimer_tick);
34-
#ifdef CONFIG_BOARD_TLSR9518ADK80D_RETENTION
35-
bool b91_deep_sleep(uint32_t wake_stimer_tick);
36-
#endif /* CONFIG_BOARD_TLSR9518ADK80D_RETENTION */
34+
#if defined(CONFIG_BOARD_TLSR9518ADK80D_RETENTION) || defined(CONFIG_BOARD_TLSR9528A_RETENTION)
35+
bool b9x_deep_sleep(uint32_t wake_stimer_tick);
36+
#endif /* CONFIG_BOARD_TLSR9518ADK80D_RETENTION || CONFIG_BOARD_TLSR9528A_RETENTION */
3737

3838
#endif /* __B9X_SLEEP_H */

tlsr9/common/B91/sleep.c tlsr9/common/sleep.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
#include <ext_driver/ext_pm.h>
2020

2121
#if CONFIG_BT_B9X
22+
#if CONFIG_SOC_RISCV_TELINK_B91
2223
#include <stack/ble/B91/controller/os_sup.h>
24+
#elif CONFIG_SOC_RISCV_TELINK_B92
25+
#include <stack/ble/B92/controller/os_sup.h>
26+
#endif
2327
#include <b9x_bt.h>
2428
#endif /* CONFIG_BT_B9X */
2529

2630
/**
27-
* @brief This function sets B91 MCU to suspend mode
31+
* @brief This function sets B9X MCU to suspend mode
2832
* @param[in] wake_stimer_tick - wake-up stimer tick
2933
* @return true if suspend mode entered otherwise false
3034
*/
@@ -59,9 +63,9 @@ bool b9x_suspend(uint32_t wake_stimer_tick)
5963
return result;
6064
}
6165

62-
#ifdef CONFIG_BOARD_TLSR9518ADK80D_RETENTION
66+
#if defined(CONFIG_BOARD_TLSR9518ADK80D_RETENTION) || defined(CONFIG_BOARD_TLSR9528A_RETENTION)
6367

64-
bool b91_deep_sleep(uint32_t wake_stimer_tick)
68+
bool b9x_deep_sleep(uint32_t wake_stimer_tick)
6569
{
6670
bool result = false;
6771
static volatile bool tl_sleep_retention
@@ -113,4 +117,4 @@ bool b91_deep_sleep(uint32_t wake_stimer_tick)
113117
return result;
114118
}
115119

116-
#endif /* CONFIG_BOARD_TLSR9518ADK80D_RETENTION */
120+
#endif /* CONFIG_BOARD_TLSR9518ADK80D_RETENTION || CONFIG_BOARD_TLSR9528A_RETENTION */

tlsr9/drivers/B92/stimer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* global macro *
5050
*********************************************************************************************************************/
5151
#ifndef SYS_TIMER_AUTO_MODE
52-
#define SYS_TIMER_AUTO_MODE 1
52+
#define SYS_TIMER_AUTO_MODE 0
5353
#endif
5454
/**********************************************************************************************************************
5555
* global data type *

zephyr/blobs/liblt_9528_zephyr.a

-5.39 MB
Binary file not shown.

zephyr/module.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ blobs:
88
type: lib
99
version: 'V4.0.1.0_Patch_0003'
1010
license-path: tlsr9/ble/license.txt
11-
url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/raw/224af1af42f0514c6a35c159c878fe34221dc689/liblt_9518_zephyr.a
11+
url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/raw/cb62c1ab79274a67c228f26a811e738d05a444b6/liblt_9518_zephyr.a
1212
description: "Binary libraries supporting Telink B91 series BLE subsystems"
13-
doc-url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/blob/224af1af42f0514c6a35c159c878fe34221dc689/README.md
13+
doc-url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/blob/cb62c1ab79274a67c228f26a811e738d05a444b6/README.md
14+
15+
- path: liblt_9528_zephyr.a
16+
sha256: 578d2629267f23d82198f21780981b7e72693a0d05f7b73410d4b007f359ee49
17+
type: lib
18+
version: 'V4.0.1.0_Patch_0003'
19+
license-path: tlsr9/ble/license.txt
20+
url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/raw/cb62c1ab79274a67c228f26a811e738d05a444b6/liblt_9528_zephyr.a
21+
description: "Binary libraries supporting Telink B92 series BLE subsystems"
22+
doc-url: https://github.com/telink-semi/zephyr_hal_telink_b91_ble_lib/blob/cb62c1ab79274a67c228f26a811e738d05a444b6/README.md

0 commit comments

Comments
 (0)