mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 03:58:12 +00:00
openthread: add SPI support in Radio Co-Processor
This commit is contained in:
@@ -45,12 +45,15 @@ UartSpinelInterface::~UartSpinelInterface(void)
|
||||
|
||||
esp_err_t UartSpinelInterface::Init(const esp_openthread_uart_config_t &radio_uart_config)
|
||||
{
|
||||
esp_err_t error = ESP_OK;
|
||||
m_uart_rx_buffer = static_cast<uint8_t *>(heap_caps_malloc(kMaxFrameSize, MALLOC_CAP_8BIT));
|
||||
if (m_uart_rx_buffer == NULL) {
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
return InitUart(radio_uart_config);
|
||||
error = InitUart(radio_uart_config);
|
||||
ESP_LOGI(OT_PLAT_LOG_TAG, "spinel UART interface initialization completed");
|
||||
return error;
|
||||
}
|
||||
|
||||
esp_err_t UartSpinelInterface::Deinit(void)
|
||||
@@ -282,5 +285,13 @@ esp_err_t UartSpinelInterface::TryRecoverUart(void)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
void UartSpinelInterface::OnRcpReset(void)
|
||||
{
|
||||
if (mRcpFailureHandler) {
|
||||
mRcpFailureHandler();
|
||||
TryRecoverUart();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace openthread
|
||||
} // namespace esp
|
||||
|
Reference in New Issue
Block a user