Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIRCUITPY_DEFAULT_WIFI_TX_POWER #9364

Merged
merged 3 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ports/espressif/boards/lolin_c3_mini/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@

#define CIRCUITPY_BOARD_UART (1)
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}}

// Reduce wifi.radio.tx_power due to the antenna design of this board
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (11.0)
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@

#define CIRCUITPY_BOARD_SPI (1)
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO4, .mosi = &pin_GPIO6, .miso = &pin_GPIO5}}

// Reduce wifi.radio.tx_power due to the antenna design of this board
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (11.0)
1 change: 1 addition & 0 deletions ports/espressif/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
if (!self->started && enabled) {
ESP_ERROR_CHECK(esp_wifi_start());
self->started = true;
common_hal_wifi_radio_set_tx_power(self, CIRCUITPY_WIFI_DEFAULT_TX_POWER);
dhalbert marked this conversation as resolved.
Show resolved Hide resolved
return;
}
}
Expand Down
6 changes: 6 additions & 0 deletions ports/espressif/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@
extern portMUX_TYPE background_task_mutex;
#define CALLBACK_CRITICAL_BEGIN (taskENTER_CRITICAL(&background_task_mutex))
#define CALLBACK_CRITICAL_END (taskEXIT_CRITICAL(&background_task_mutex))

// 20 dBm is the default and the highest max tx power.
// Allow a different value to be specified for boards that have trouble with using the maximum power.
#ifndef CIRCUITPY_WIFI_DEFAULT_TX_POWER
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (20)
#endif
Loading