esp-rs / esp-hal

no_std Hardware Abstraction Layers for ESP32 microcontrollers
https://docs.esp-rs.org/esp-hal/
Apache License 2.0
639 stars 178 forks source link

Validate wifi configuration #1611

Open bugadani opened 9 months ago

bugadani commented 9 months ago

esp-idf does some validation on the configuration, e.g.


#if (CONFIG_ESP_WIFI_RX_BA_WIN > CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM)
#error "WiFi configuration check: WARNING, WIFI_RX_BA_WIN should not be larger than WIFI_DYNAMIC_RX_BUFFER_NUM!"
#endif

#if (CONFIG_ESP_WIFI_RX_BA_WIN > (CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM << 1))
#error "WiFi configuration check: WARNING, WIFI_RX_BA_WIN should not be larger than double of the WIFI_STATIC_RX_BUFFER_NUM!"
#endif

It might be helpful to do the same in esp-wifi, too.

bugadani commented 9 months ago

Also, slightly offtopic but loosely related to configuration: I found that components/esp_wifi/Kconfig contains the descriptions of the various options. We might indicate this somehow either by linking to the file or by copying the descriptions. e.g.: https://github.com/espressif/esp-idf/blob/b4268c874a4cf8fcf7c0c4153cffb76ad2ddda4e/components/esp_wifi/Kconfig#L32