mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'feat/calibrate_bus_latency_v5.2' into 'release/v5.2'
Feat/calibrate bus latency v5.2 See merge request espressif/esp-idf!39133
This commit is contained in:
@ -263,6 +263,13 @@ menu "OpenThread"
|
|||||||
help
|
help
|
||||||
Select this option to enable link metrics feature
|
Select this option to enable link metrics feature
|
||||||
|
|
||||||
|
config OPENTHREAD_BORDER_AGENT_ENABLE
|
||||||
|
bool "Enable border agent feature"
|
||||||
|
default y if OPENTHREAD_BORDER_ROUTER
|
||||||
|
default n if !OPENTHREAD_BORDER_ROUTER
|
||||||
|
help
|
||||||
|
Select this option to enable border agent feature
|
||||||
|
|
||||||
config OPENTHREAD_MACFILTER_ENABLE
|
config OPENTHREAD_MACFILTER_ENABLE
|
||||||
bool "Enable mac filter feature"
|
bool "Enable mac filter feature"
|
||||||
default n
|
default n
|
||||||
@ -400,6 +407,12 @@ menu "OpenThread"
|
|||||||
help
|
help
|
||||||
The device's XTAL accuracy, in ppm.
|
The device's XTAL accuracy, in ppm.
|
||||||
|
|
||||||
|
config OPENTHREAD_BUS_LATENCY
|
||||||
|
int "The bus latency between host and radio chip"
|
||||||
|
default 4000
|
||||||
|
help
|
||||||
|
The device's bus latency, in us.
|
||||||
|
|
||||||
config OPENTHREAD_MLE_MAX_CHILDREN
|
config OPENTHREAD_MLE_MAX_CHILDREN
|
||||||
int "The size of max MLE children entries"
|
int "The size of max MLE children entries"
|
||||||
default 10
|
default 10
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
archive: libopenthread.a
|
archive: libopenthread.a
|
||||||
entries:
|
entries:
|
||||||
if OPENTHREAD_CSL_ENABLE = y || OPENTHREAD_LINK_METRICS = y:
|
if OPENTHREAD_CSL_ENABLE = y || OPENTHREAD_LINK_METRICS = y:
|
||||||
mesh_forwarder (noflash_text)
|
csl_tx_scheduler (noflash)
|
||||||
mac_frame (noflash_text)
|
link_metrics (noflash)
|
||||||
csl_tx_scheduler (noflash_text)
|
link_quality (noflash)
|
||||||
link_metrics (noflash_text)
|
mac (noflash)
|
||||||
mac (noflash_text)
|
mac_frame (noflash)
|
||||||
sub_mac (noflash_text)
|
mesh_forwarder (noflash)
|
||||||
|
radio (noflash)
|
||||||
|
sub_mac (noflash)
|
||||||
|
|
||||||
if OPENTHREAD_RCP_SPI = y:
|
if OPENTHREAD_RCP_SPI = y:
|
||||||
ncp_spi (noflash_text)
|
ncp_spi (noflash)
|
||||||
|
@ -44,6 +44,14 @@ void esp_openthread_radio_deinit(void);
|
|||||||
*/
|
*/
|
||||||
void esp_openthread_radio_update(esp_openthread_mainloop_context_t *mainloop);
|
void esp_openthread_radio_update(esp_openthread_mainloop_context_t *mainloop);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles netif change for radio spinel.
|
||||||
|
*
|
||||||
|
* @param[in] state The updated netif state.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void esp_openthread_handle_netif_state_change(bool state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function performs the OpenThread radio process.
|
* @brief This function performs the OpenThread radio process.
|
||||||
*
|
*
|
||||||
|
@ -367,19 +367,24 @@
|
|||||||
#endif
|
#endif
|
||||||
#define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
#define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||||
|
|
||||||
/*----The following options set fixed default values but can be overridden by the user header file.----*/
|
|
||||||
|
|
||||||
#if CONFIG_OPENTHREAD_BORDER_ROUTER
|
|
||||||
/**
|
/**
|
||||||
* @def OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
* @def OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
||||||
*
|
*
|
||||||
* Define to 1 to enable Border Agent support.
|
* Define to 1 to enable Border Agent support.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
#ifdef OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
||||||
|
#error `OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE` is redefined.
|
||||||
|
#endif
|
||||||
|
#if CONFIG_OPENTHREAD_BORDER_AGENT_ENABLE
|
||||||
#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 1
|
#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 1
|
||||||
|
#else
|
||||||
|
#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*----The following options set fixed default values but can be overridden by the user header file.----*/
|
||||||
|
|
||||||
|
#if CONFIG_OPENTHREAD_BORDER_ROUTER
|
||||||
/**
|
/**
|
||||||
* @def OPENTHREAD_CONFIG_BORDER_AGENT_ID_ENABLE
|
* @def OPENTHREAD_CONFIG_BORDER_AGENT_ID_ENABLE
|
||||||
*
|
*
|
||||||
|
@ -209,6 +209,11 @@ void esp_openthread_radio_update(esp_openthread_mainloop_context_t *mainloop)
|
|||||||
s_spinel_interface.GetSpinelInterface().UpdateFdSet((void *)mainloop);
|
s_spinel_interface.GetSpinelInterface().UpdateFdSet((void *)mainloop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esp_openthread_handle_netif_state_change(bool state)
|
||||||
|
{
|
||||||
|
s_radio.SetTimeSyncState(state);
|
||||||
|
}
|
||||||
|
|
||||||
void otPlatRadioGetIeeeEui64(otInstance *instance, uint8_t *ieee_eui64)
|
void otPlatRadioGetIeeeEui64(otInstance *instance, uint8_t *ieee_eui64)
|
||||||
{
|
{
|
||||||
SuccessOrDie(s_radio.GetIeeeEui64(ieee_eui64));
|
SuccessOrDie(s_radio.GetIeeeEui64(ieee_eui64));
|
||||||
@ -523,3 +528,27 @@ uint32_t otPlatRadioGetSupportedChannelMask(otInstance *aInstance)
|
|||||||
// Refer to `GetRadioChannelMask(bool aPreferred)`: FALSE to get supported channel mask
|
// Refer to `GetRadioChannelMask(bool aPreferred)`: FALSE to get supported channel mask
|
||||||
return s_radio.GetRadioChannelMask(false);
|
return s_radio.GetRadioChannelMask(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t otPlatRadioGetBusSpeed(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
OT_UNUSED_VARIABLE(aInstance);
|
||||||
|
|
||||||
|
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART
|
||||||
|
return s_esp_openthread_radio_config->radio_uart_config.uart_config.baud_rate;
|
||||||
|
#elif CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
|
||||||
|
return s_esp_openthread_radio_config->radio_spi_config.spi_device.clock_speed_hz;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t otPlatRadioGetBusLatency(otInstance *aInstance)
|
||||||
|
{
|
||||||
|
OT_UNUSED_VARIABLE(aInstance);
|
||||||
|
|
||||||
|
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART || CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
|
||||||
|
return CONFIG_OPENTHREAD_BUS_LATENCY;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
static void handle_ot_netif_state_change(otInstance* instance)
|
static void handle_ot_netif_state_change(otInstance* instance)
|
||||||
{
|
{
|
||||||
if (otLinkIsEnabled(instance)) {
|
if (otIp6IsEnabled(instance)) {
|
||||||
ESP_LOGI(TAG, "netif up");
|
ESP_LOGI(TAG, "netif up");
|
||||||
if (esp_event_post(OPENTHREAD_EVENT, OPENTHREAD_EVENT_IF_UP, NULL, 0, 0) != ESP_OK) {
|
if (esp_event_post(OPENTHREAD_EVENT, OPENTHREAD_EVENT_IF_UP, NULL, 0, 0) != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Failed to post OpenThread if up event");
|
ESP_LOGE(TAG, "Failed to post OpenThread if up event");
|
||||||
@ -32,6 +32,10 @@ static void handle_ot_netif_state_change(otInstance* instance)
|
|||||||
ESP_LOGE(TAG, "Failed to post OpenThread if down event");
|
ESP_LOGE(TAG, "Failed to post OpenThread if down event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (CONFIG_OPENTHREAD_RADIO_SPINEL_UART || CONFIG_OPENTHREAD_RADIO_SPINEL_SPI)
|
||||||
|
esp_openthread_handle_netif_state_change(otIp6IsEnabled(instance));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_ot_netdata_change(void)
|
static void handle_ot_netdata_change(void)
|
||||||
|
Reference in New Issue
Block a user