Last active
May 23, 2026 11:30
-
-
Save rayanamal/d3ad1f96afc9c8bb7bc9dfa4a4eb0d7e to your computer and use it in GitHub Desktop.
Patch to enable external antenna on the XIAO-ESP32-C6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/examples/openthread/ot_rcp/main/esp_ot_rcp.c b/examples/openthread/ot_rcp/main/esp_ot_rcp.c | |
| index 765fef58a2..bf97db1c77 100644 | |
| --- a/examples/openthread/ot_rcp/main/esp_ot_rcp.c | |
| +++ b/examples/openthread/ot_rcp/main/esp_ot_rcp.c | |
| @@ -31,10 +31,25 @@ | |
| #define TAG "ot_esp_rcp" | |
| +#include "driver/gpio.h" | |
| +#include "freertos/FreeRTOS.h" | |
| +#include "freertos/task.h" | |
| + | |
| +static void xiao_select_external_antenna(void) | |
| +{ | |
| + gpio_set_direction(GPIO_NUM_3, GPIO_MODE_OUTPUT); | |
| + gpio_set_level(GPIO_NUM_3, 0); | |
| + vTaskDelay(pdMS_TO_TICKS(100)); | |
| + gpio_set_direction(GPIO_NUM_14, GPIO_MODE_OUTPUT); | |
| + gpio_set_level(GPIO_NUM_14, 1); | |
| +} | |
| + | |
| extern void otAppNcpInit(otInstance *instance); | |
| void app_main(void) | |
| { | |
| + xiao_select_external_antenna(); | |
| + | |
| // Used eventfds: | |
| // * ot task queue | |
| // * radio driver | |
| @@ -57,4 +72,4 @@ void app_main(void) | |
| }; | |
| ESP_ERROR_CHECK(esp_openthread_start(&config)); | |
| -} | |
| +} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment