Skip to content

Commit bdabba8

Browse files
authored
Merge pull request #9364 from bill88t/sup_wemos_lowpow
CIRCUITPY_DEFAULT_WIFI_TX_POWER
2 parents cbd5131 + bb5a811 commit bdabba8

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

ports/espressif/boards/lolin_c3_mini/mpconfigboard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@
2626

2727
#define CIRCUITPY_BOARD_UART (1)
2828
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}}
29+
30+
// Reduce wifi.radio.tx_power due to the antenna design of this board
31+
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (11.0)

ports/espressif/boards/makergo_esp32c3_supermini/mpconfigboard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222

2323
#define CIRCUITPY_BOARD_SPI (1)
2424
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO4, .mosi = &pin_GPIO6, .miso = &pin_GPIO5}}
25+
26+
// Reduce wifi.radio.tx_power due to the antenna design of this board
27+
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (11.0)

ports/espressif/common-hal/wifi/Radio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
8686
if (!self->started && enabled) {
8787
ESP_ERROR_CHECK(esp_wifi_start());
8888
self->started = true;
89+
common_hal_wifi_radio_set_tx_power(self, CIRCUITPY_WIFI_DEFAULT_TX_POWER);
8990
return;
9091
}
9192
}

ports/espressif/mpconfigport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@
5959
extern portMUX_TYPE background_task_mutex;
6060
#define CALLBACK_CRITICAL_BEGIN (taskENTER_CRITICAL(&background_task_mutex))
6161
#define CALLBACK_CRITICAL_END (taskEXIT_CRITICAL(&background_task_mutex))
62+
63+
// 20 dBm is the default and the highest max tx power.
64+
// Allow a different value to be specified for boards that have trouble with using the maximum power.
65+
#ifndef CIRCUITPY_WIFI_DEFAULT_TX_POWER
66+
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (20)
67+
#endif

0 commit comments

Comments
 (0)