fix(ble): added null pointer check in ble log ts submodule
(cherry picked from commit 2b9c7471d0f3841f36f8a4a01aae79b6d08e0cbd) Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
This commit is contained in:
@@ -60,7 +60,9 @@ BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void ble_log_rt_task(void *pvParameters)
|
||||
if (rt_ts_enabled) {
|
||||
ble_log_ts_info_t *ts_info = NULL;
|
||||
ble_log_ts_info_update(&ts_info);
|
||||
ble_log_write_hex(BLE_LOG_SRC_INTERNAL, (const uint8_t *)ts_info, sizeof(ble_log_ts_info_t));
|
||||
if (ts_info) {
|
||||
ble_log_write_hex(BLE_LOG_SRC_INTERNAL, (const uint8_t *)ts_info, sizeof(ble_log_ts_info_t));
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_BLE_LOG_TS_ENABLED */
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@ void ble_log_ts_deinit(void)
|
||||
|
||||
void ble_log_ts_info_update(ble_log_ts_info_t **info)
|
||||
{
|
||||
if (!ts_inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
BLE_LOG_ENTER_CRITICAL();
|
||||
ts_info->io_level = !ts_info->io_level;
|
||||
gpio_set_level(CONFIG_BLE_LOG_SYNC_IO_NUM, ts_info->io_level);
|
||||
@@ -76,6 +80,10 @@ void ble_log_ts_info_update(ble_log_ts_info_t **info)
|
||||
|
||||
void ble_log_ts_reset(bool status)
|
||||
{
|
||||
if (!ts_inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!status && !ts_info->io_level) {
|
||||
gpio_set_level(CONFIG_BLE_LOG_SYNC_IO_NUM, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user