forked from espressif/arduino-esp32
Added ESP32-WROOM-DA module to boards.txt (#6361)
Added dual antenna configuration based on the module selection Added warning to the example on how to use the DA
This commit is contained in:
@ -24,7 +24,12 @@ void setup()
|
||||
// Set WiFi to station mode and disconnect from an AP if it was previously connected
|
||||
WiFi.mode(WIFI_STA);
|
||||
|
||||
// Set WiFi dual antenna configuration by passing the GPIO and antenna mode for RX ant TX
|
||||
/* Attention: This is the manual prodecure for the dual antenna configuration.
|
||||
* If you choose the ESP32-WROOM-DA module from the Tools -> Board, this configuration
|
||||
* is not necessary!
|
||||
*
|
||||
* Set WiFi dual antenna configuration by passing the GPIO and antenna mode for RX ant TX
|
||||
*/
|
||||
err = WiFi.setDualAntennaConfig(GPIO_ANT1, GPIO_ANT1, WIFI_RX_ANT_AUTO, WIFI_TX_ANT_AUTO);
|
||||
|
||||
/* For more details on how to use this feature, see our docs:
|
||||
|
@ -1061,6 +1061,14 @@ bool WiFiGenericClass::mode(wifi_mode_t m)
|
||||
if(!espWiFiStart()){
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef BOARD_HAS_DUAL_ANTENNA
|
||||
if(!setDualAntennaConfig(ANT1, ANT2, WIFI_RX_ANT_AUTO, WIFI_TX_ANT_AUTO)){
|
||||
log_e("Dual Antenna Config failed!");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ class WiFiGenericClass
|
||||
|
||||
bool initiateFTM(uint8_t frm_count=16, uint16_t burst_period=2, uint8_t channel=1, const uint8_t * mac=NULL);
|
||||
|
||||
bool setDualAntennaConfig(uint8_t gpio_ant1, uint8_t gpio_ant2, wifi_rx_ant_t rx_mode, wifi_tx_ant_t tx_mode);
|
||||
static bool setDualAntennaConfig(uint8_t gpio_ant1, uint8_t gpio_ant2, wifi_rx_ant_t rx_mode, wifi_tx_ant_t tx_mode);
|
||||
|
||||
static const char * getHostname();
|
||||
static bool setHostname(const char * hostname);
|
||||
|
Reference in New Issue
Block a user