Unverified Commit 38d6ed5f authored by CIncinnatus's avatar CIncinnatus Committed by GitHub

Enabled the onboard ceramic antenna by default when creating a new project...

Enabled the onboard ceramic antenna by default when creating a new project with XIAO_ESP32C6 (#10066)

* Create variant.cpp

* Update variant.cpp

* Update variant.cpp

* Update pins_arduino.h

* Update variant.cpp

* Update variant.cpp

* Update variant.cpp

* Update variants/XIAO_ESP32C6/variant.cpp
Co-authored-by: default avatarJan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* ci(pre-commit): Apply automatic fixes

---------
Co-authored-by: default avatarJan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: default avatarpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
parent dd86244b
......@@ -41,4 +41,7 @@ static const uint8_t D8 = 19;
static const uint8_t D9 = 20;
static const uint8_t D10 = 18;
static const uint8_t WIFI_ENABLE = 3;
static const uint8_t WIFI_ANT_CONFIG = 14;
#endif /* Pins_Arduino_h */
/*
*By setting the WIFI_ENABLE and WIFI_ANT_CONFIG pins,
*
*the XIAO_ESP32C6 will turn on the on-board antenna by default after power-on
*
*https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/
*/
#include "esp32-hal-gpio.h"
#include "pins_arduino.h"
extern "C" {
void initVariant(void) {
pinMode(WIFI_ENABLE, OUTPUT);
digitalWrite(WIFI_ENABLE, LOW); //turn on this function
pinMode(WIFI_ANT_CONFIG, OUTPUT);
digitalWrite(WIFI_ANT_CONFIG, LOW); //use built-in antenna, set HIGH to use external antenna
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment