fix(build): Fix many warnings
This commit is contained in:
parent
e1673e4c0c
commit
f77ce040db
7 changed files with 37 additions and 35 deletions
|
|
@ -21,7 +21,7 @@
|
|||
#include "soc/rtc.h"
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#include "soc/rtc_cntl_reg.h"
|
||||
#include "soc/apb_ctrl_reg.h"
|
||||
#include "soc/syscon_reg.h"
|
||||
#endif
|
||||
#include "soc/efuse_reg.h"
|
||||
#include "esp32-hal.h"
|
||||
|
|
@ -30,13 +30,13 @@
|
|||
#include "esp_system.h"
|
||||
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
|
||||
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
|
||||
#include "freertos/xtensa_timer.h"
|
||||
#include "xtensa_timer.h"
|
||||
#include "esp32/rom/rtc.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
#include "freertos/xtensa_timer.h"
|
||||
#include "xtensa_timer.h"
|
||||
#include "esp32s2/rom/rtc.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "freertos/xtensa_timer.h"
|
||||
#include "xtensa_timer.h"
|
||||
#include "esp32s3/rom/rtc.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C2
|
||||
#include "esp32c2/rom/rtc.h"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "soc/rtc.h"
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
|
||||
#include "soc/rtc_cntl_reg.h"
|
||||
#include "soc/apb_ctrl_reg.h"
|
||||
#include "soc/syscon_reg.h"
|
||||
#endif
|
||||
#include "esp_task_wdt.h"
|
||||
#include "esp32-hal.h"
|
||||
|
|
@ -147,14 +147,14 @@ void feedLoopWDT() {
|
|||
#endif
|
||||
|
||||
void enableCore0WDT() {
|
||||
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0);
|
||||
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCore(0);
|
||||
if (idle_0 == NULL || esp_task_wdt_add(idle_0) != ESP_OK) {
|
||||
log_e("Failed to add Core 0 IDLE task to WDT");
|
||||
}
|
||||
}
|
||||
|
||||
void disableCore0WDT() {
|
||||
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0);
|
||||
TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCore(0);
|
||||
if (idle_0 == NULL || esp_task_wdt_delete(idle_0) != ESP_OK) {
|
||||
log_e("Failed to remove Core 0 IDLE task from WDT");
|
||||
}
|
||||
|
|
@ -162,14 +162,14 @@ void disableCore0WDT() {
|
|||
|
||||
#ifndef CONFIG_FREERTOS_UNICORE
|
||||
void enableCore1WDT() {
|
||||
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1);
|
||||
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCore(1);
|
||||
if (idle_1 == NULL || esp_task_wdt_add(idle_1) != ESP_OK) {
|
||||
log_e("Failed to add Core 1 IDLE task to WDT");
|
||||
}
|
||||
}
|
||||
|
||||
void disableCore1WDT() {
|
||||
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1);
|
||||
TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCore(1);
|
||||
if (idle_1 == NULL || esp_task_wdt_delete(idle_1) != ESP_OK) {
|
||||
log_e("Failed to remove Core 1 IDLE task from WDT");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -698,7 +698,7 @@ static bool _init_bt(const char *deviceName, bt_mode mode) {
|
|||
}
|
||||
|
||||
log_i("device name set");
|
||||
esp_bt_dev_set_device_name(deviceName);
|
||||
esp_bt_gap_set_device_name(deviceName);
|
||||
|
||||
if (_enableSSP) {
|
||||
log_i("Simple Secure Pairing");
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#define I2S_READ_CHUNK_SIZE 1920
|
||||
|
||||
#define I2S_DEFAULT_CFG() \
|
||||
{ .id = I2S_NUM_AUTO, .role = I2S_ROLE_MASTER, .dma_desc_num = 6, .dma_frame_num = 240, .auto_clear = true, }
|
||||
{ .id = I2S_NUM_AUTO, .role = I2S_ROLE_MASTER, .dma_desc_num = 6, .dma_frame_num = 240, .auto_clear = true, .auto_clear_before_cb = false, .intr_priority = 0 }
|
||||
|
||||
#define I2S_STD_CHAN_CFG(_sample_rate, _data_bit_width, _slot_mode) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -181,8 +181,8 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
|
|||
: (2 == clock_mode) ? EMAC_CLK_OUT_GPIO
|
||||
: (3 == clock_mode) ? EMAC_CLK_OUT_180_GPIO
|
||||
: EMAC_CLK_IN_GPIO;
|
||||
mac_config.smi_mdc_gpio_num = digitalPinToGPIONumber(mdc);
|
||||
mac_config.smi_mdio_gpio_num = digitalPinToGPIONumber(mdio);
|
||||
mac_config.smi_gpio.mdc_num = digitalPinToGPIONumber(mdc);
|
||||
mac_config.smi_gpio.mdio_num = digitalPinToGPIONumber(mdio);
|
||||
|
||||
_pin_mcd = digitalPinToGPIONumber(mdc);
|
||||
_pin_mdio = digitalPinToGPIONumber(mdio);
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@ bool SDMMCFS::begin(const char *mountpoint, bool mode1bit, bool format_if_mount_
|
|||
_mode1bit = mode1bit;
|
||||
|
||||
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
|
||||
.format_if_mount_failed = format_if_mount_failed, .max_files = maxOpenFiles, .allocation_unit_size = 0, .disk_status_check_enable = false
|
||||
.format_if_mount_failed = format_if_mount_failed, .max_files = maxOpenFiles, .allocation_unit_size = 0, .disk_status_check_enable = false,
|
||||
.use_one_fat = false
|
||||
};
|
||||
|
||||
esp_err_t ret = esp_vfs_fat_sdmmc_mount(mountpoint, &host, &slot_config, &mount_config, &_card);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ extern "C" {
|
|||
#include <esp_event.h>
|
||||
#include <esp_mac.h>
|
||||
#include <esp_netif.h>
|
||||
#include <esp_phy.h>
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/err.h"
|
||||
|
|
@ -693,9 +694,9 @@ bool WiFiGenericClass::initiateFTM(uint8_t frm_count, uint16_t burst_period, uin
|
|||
*/
|
||||
bool WiFiGenericClass::setDualAntennaConfig(uint8_t gpio_ant1, uint8_t gpio_ant2, wifi_rx_ant_t rx_mode, wifi_tx_ant_t tx_mode) {
|
||||
|
||||
wifi_ant_gpio_config_t wifi_ant_io;
|
||||
esp_phy_ant_gpio_config_t wifi_ant_io;
|
||||
|
||||
if (ESP_OK != esp_wifi_get_ant_gpio(&wifi_ant_io)) {
|
||||
if (ESP_OK != esp_phy_get_ant_gpio(&wifi_ant_io)) {
|
||||
log_e("Failed to get antenna configuration");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -705,56 +706,56 @@ bool WiFiGenericClass::setDualAntennaConfig(uint8_t gpio_ant1, uint8_t gpio_ant2
|
|||
wifi_ant_io.gpio_cfg[1].gpio_num = gpio_ant2;
|
||||
wifi_ant_io.gpio_cfg[1].gpio_select = 1;
|
||||
|
||||
if (ESP_OK != esp_wifi_set_ant_gpio(&wifi_ant_io)) {
|
||||
if (ESP_OK != esp_phy_set_ant_gpio(&wifi_ant_io)) {
|
||||
log_e("Failed to set antenna GPIO configuration");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set antenna default configuration
|
||||
wifi_ant_config_t ant_config = {
|
||||
.rx_ant_mode = WIFI_ANT_MODE_AUTO,
|
||||
.rx_ant_default = WIFI_ANT_MAX, // Ignored in AUTO mode
|
||||
.tx_ant_mode = WIFI_ANT_MODE_AUTO,
|
||||
esp_phy_ant_config_t ant_config = {
|
||||
.rx_ant_mode = ESP_PHY_ANT_MODE_AUTO,
|
||||
.rx_ant_default = ESP_PHY_ANT_MAX, // Ignored in AUTO mode
|
||||
.tx_ant_mode = ESP_PHY_ANT_MODE_AUTO,
|
||||
.enabled_ant0 = 1,
|
||||
.enabled_ant1 = 2,
|
||||
};
|
||||
|
||||
switch (rx_mode) {
|
||||
case WIFI_RX_ANT0: ant_config.rx_ant_mode = WIFI_ANT_MODE_ANT0; break;
|
||||
case WIFI_RX_ANT1: ant_config.rx_ant_mode = WIFI_ANT_MODE_ANT1; break;
|
||||
case WIFI_RX_ANT0: ant_config.rx_ant_mode = ESP_PHY_ANT_MODE_ANT0; break;
|
||||
case WIFI_RX_ANT1: ant_config.rx_ant_mode = ESP_PHY_ANT_MODE_ANT1; break;
|
||||
case WIFI_RX_ANT_AUTO:
|
||||
log_i("TX Antenna will be automatically selected");
|
||||
ant_config.rx_ant_default = WIFI_ANT_ANT0;
|
||||
ant_config.rx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.rx_ant_default = ESP_PHY_ANT_ANT0;
|
||||
ant_config.rx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
// Force TX for AUTO if RX is AUTO
|
||||
ant_config.tx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.tx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
goto set_ant;
|
||||
break;
|
||||
default:
|
||||
log_e("Invalid default antenna! Falling back to AUTO");
|
||||
ant_config.rx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.rx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (tx_mode) {
|
||||
case WIFI_TX_ANT0: ant_config.tx_ant_mode = WIFI_ANT_MODE_ANT0; break;
|
||||
case WIFI_TX_ANT1: ant_config.tx_ant_mode = WIFI_ANT_MODE_ANT1; break;
|
||||
case WIFI_TX_ANT0: ant_config.tx_ant_mode = ESP_PHY_ANT_MODE_ANT0; break;
|
||||
case WIFI_TX_ANT1: ant_config.tx_ant_mode = ESP_PHY_ANT_MODE_ANT1; break;
|
||||
case WIFI_TX_ANT_AUTO:
|
||||
log_i("RX Antenna will be automatically selected");
|
||||
ant_config.rx_ant_default = WIFI_ANT_ANT0;
|
||||
ant_config.tx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.rx_ant_default = ESP_PHY_ANT_ANT0;
|
||||
ant_config.tx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
// Force RX for AUTO if RX is AUTO
|
||||
ant_config.rx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.rx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
break;
|
||||
default:
|
||||
log_e("Invalid default antenna! Falling back to AUTO");
|
||||
ant_config.rx_ant_default = WIFI_ANT_ANT0;
|
||||
ant_config.tx_ant_mode = WIFI_ANT_MODE_AUTO;
|
||||
ant_config.rx_ant_default = ESP_PHY_ANT_ANT0;
|
||||
ant_config.tx_ant_mode = ESP_PHY_ANT_MODE_AUTO;
|
||||
break;
|
||||
}
|
||||
|
||||
set_ant:
|
||||
if (ESP_OK != esp_wifi_set_ant(&ant_config)) {
|
||||
if (ESP_OK != esp_phy_set_ant(&ant_config)) {
|
||||
log_e("Failed to set antenna configuration");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue