To achieve maximum throughput for the BLE dongle.
1. Set the maximum connection interval to 20ms. 2. Refactory pseudo_data_task() 3. Decrease size of regular_data_q
This commit is contained in:
+8
-8
@@ -101,16 +101,16 @@ static void pseudo_data_task(void *pArg)
|
||||
void (*pfCallback)(channel_data_t *p_channel_data) = pArg;
|
||||
for (;;)
|
||||
{
|
||||
vTaskDelay(pdMS_TO_TICKS(1));
|
||||
channel_data_t ch_data;
|
||||
memset(&ch_data, 0x00, sizeof(ch_data));
|
||||
for (int i = 0; i < 1; i++)
|
||||
pfCallback(&ch_data);
|
||||
if (xQueueSend(regular_data_q, &ch_data, pdMS_TO_TICKS(50)) == pdFAIL)
|
||||
{
|
||||
pfCallback(&ch_data);
|
||||
if (xQueueSend(regular_data_q, &ch_data, pdMS_TO_TICKS(100)) == pdFAIL)
|
||||
{
|
||||
__BKPT(255);
|
||||
}
|
||||
__BKPT(255);
|
||||
}
|
||||
else
|
||||
{
|
||||
portYIELD();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ static void eis_regular_data_handler(ble_evt_t const *p_ble_evt, void *p_context
|
||||
|
||||
void eis_regular_data_init(void)
|
||||
{
|
||||
regular_data_q = xQueueCreate(512, sizeof(channel_data_t));
|
||||
regular_data_q = xQueueCreate(64, sizeof(channel_data_t));
|
||||
if (regular_data_q == NULL)
|
||||
{
|
||||
// Will not get here unless there is insufficient RAM.
|
||||
|
||||
@@ -41,7 +41,7 @@ void le_gap_init(const char *device_name, uint16_t usAppearance)
|
||||
ble_gap_conn_params_t gap_conn_params;
|
||||
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
|
||||
gap_conn_params.min_conn_interval = MSEC_TO_UNITS(8, UNIT_1_25_MS); /**< Minimum connection interval (7.5 ms) */
|
||||
gap_conn_params.max_conn_interval = MSEC_TO_UNITS(400, UNIT_1_25_MS); /**< Maximum connection interval (400 ms). */
|
||||
gap_conn_params.max_conn_interval = MSEC_TO_UNITS(20, UNIT_1_25_MS); /**< Maximum connection interval (20 ms). */
|
||||
gap_conn_params.slave_latency = 8; /**< Slave latency. */
|
||||
gap_conn_params.conn_sup_timeout = MSEC_TO_UNITS(10000, UNIT_10_MS); /**< Connection supervisory timeout (10s). */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user