mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'feat/ble-log-iram-optim_v6.1' into 'release/v6.1'
opt(bt): Move SPI Tx Callback to Flash When SPI ISR IN IRAM Disabled (6.1) See merge request espressif/esp-idf!48925
This commit is contained in:
@@ -17,8 +17,7 @@ if BLE_LOG_ENABLED
|
|||||||
|
|
||||||
config BLE_LOG_LBM_TRANS_BUF_SIZE
|
config BLE_LOG_LBM_TRANS_BUF_SIZE
|
||||||
int "Total buffer memory per common LBM (bytes)"
|
int "Total buffer memory per common LBM (bytes)"
|
||||||
default 2048 if BT_BLUEDROID_ENABLED
|
default 2048
|
||||||
default 4096 if BT_NIMBLE_ENABLED
|
|
||||||
help
|
help
|
||||||
Total buffer memory allocated for each common pool log buffer
|
Total buffer memory allocated for each common pool log buffer
|
||||||
manager (LBM). This memory is divided equally among internal
|
manager (LBM). This memory is divided equally among internal
|
||||||
|
|||||||
@@ -20,6 +20,12 @@
|
|||||||
#define BLE_LOG_SPI_DMA_ALIGN_BYTES (4U)
|
#define BLE_LOG_SPI_DMA_ALIGN_BYTES (4U)
|
||||||
#define BLE_LOG_SPI_ALIGN_LOG_PERIOD (256U)
|
#define BLE_LOG_SPI_ALIGN_LOG_PERIOD (256U)
|
||||||
|
|
||||||
|
#if CONFIG_SPI_MASTER_ISR_IN_IRAM
|
||||||
|
#define BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_IRAM_ATTR
|
||||||
|
#else
|
||||||
|
#define BLE_LOG_SPI_MASTER_DMA_CB_ATTR
|
||||||
|
#endif
|
||||||
|
|
||||||
/* VARIABLE */
|
/* VARIABLE */
|
||||||
BLE_LOG_STATIC bool prph_inited = false;
|
BLE_LOG_STATIC bool prph_inited = false;
|
||||||
BLE_LOG_STATIC spi_device_handle_t dev_handle = NULL;
|
BLE_LOG_STATIC spi_device_handle_t dev_handle = NULL;
|
||||||
@@ -30,7 +36,7 @@ BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans);
|
|||||||
BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans);
|
BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans);
|
||||||
|
|
||||||
/* PRIVATE FUNCTION */
|
/* PRIVATE FUNCTION */
|
||||||
BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans)
|
BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_t *spi_trans)
|
||||||
{
|
{
|
||||||
/* SPI slave performance issue workaround */
|
/* SPI slave performance issue workaround */
|
||||||
last_tx_done_ts = esp_timer_get_time();
|
last_tx_done_ts = esp_timer_get_time();
|
||||||
@@ -43,7 +49,7 @@ BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_tx_done_cb(spi_transaction_
|
|||||||
__atomic_store_n(&trans->prph_owned, false, __ATOMIC_RELEASE);
|
__atomic_store_n(&trans->prph_owned, false, __ATOMIC_RELEASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
BLE_LOG_IRAM_ATTR BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans)
|
BLE_LOG_SPI_MASTER_DMA_CB_ATTR BLE_LOG_STATIC void spi_master_dma_pre_tx_cb(spi_transaction_t *spi_trans)
|
||||||
{
|
{
|
||||||
/* SPI slave performance issue workaround */
|
/* SPI slave performance issue workaround */
|
||||||
while ((esp_timer_get_time() - last_tx_done_ts) < BLE_LOG_SPI_TRANS_ITVL_MIN_US) {}
|
while ((esp_timer_get_time() - last_tx_done_ts) < BLE_LOG_SPI_TRANS_ITVL_MIN_US) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user