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

Fix some warnings with ESP-IDF >= 5 (AUD-4923) #1083

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stintel
Copy link
Contributor

@stintel stintel commented Sep 27, 2023

When building Willow with ESP-IDF 5.1, a bunch of warnings appear due to GCC 12 being much stricter and ESP-IDF deprecating some code used by ESP-ADF. We've suppressed some of those warnings with the following skdconfig changes:

CONFIG_ADC_SUPPRESS_DEPRECATE_WARN=y
CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN=y
CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y

Afterwards, a few warnings remain. This PR, and espressif/esp-adf-libs#27 fix the remaining warnings we see.

@github-actions github-actions bot changed the title Fix some warnings with ESP-IDF >= 5 Fix some warnings with ESP-IDF >= 5 (AUD-4923) Sep 27, 2023
Fix the following warnings when building with ESP-IDF 5:

    In file included from /willow/deps/esp-adf/components/audio_stream/lib/gzip/miniz_inflate.h:32,
                     from /willow/deps/esp-adf/components/audio_stream/lib/gzip/gzip_miniz.c:30:
    /opt/esp/idf/components/esp_rom/include/esp32s3/rom/miniz.h:7:2: warning: #warning "{target}/rom/miniz.h is deprecated, please use (#include "miniz.h") instead" [-Wcpp]
        7 | #warning "{target}/rom/miniz.h is deprecated, please use (#include "miniz.h") instead"
          |  ^~~~~~~

    /willow/deps/esp-adf/components/audio_stream/i2s_stream.c:142:5: warning: 'dma_buf_count' is deprecated [-Wdeprecated-declarations]
      142 |     int index = i2s->config.i2s_config.dma_buf_count;
          |     ^~~
    In file included from /opt/esp/idf/components/driver/deprecated/driver/i2s.h:20,
                     from /willow/deps/esp-adf/components/audio_stream/i2s_stream.c:33:
    /opt/esp/idf/components/driver/deprecated/driver/i2s_types_legacy.h:225:13: note: declared here
      225 |         int dma_buf_count __attribute__((deprecated));  /*!< This is an alias to 'dma_desc_num' for backward compatibility */
          |             ^~~~~~~~~~~~~

    /willow/deps/esp-adf/components/audio_stream/i2s_stream.c:143:5: warning: 'dma_buf_len' is deprecated [-Wdeprecated-declarations]
      143 |     uint8_t *buf = audio_calloc(1, i2s->config.i2s_config.dma_buf_len * 4);
          |     ^~~~~~~
    /opt/esp/idf/components/driver/deprecated/driver/i2s_types_legacy.h:229:13: note: declared here
      229 |         int dma_buf_len __attribute__((deprecated));    /*!< This is an alias to 'dma_frame_num' for backward compatibility */
          |             ^~~~~~~~~~~
    /willow/deps/esp-adf/components/audio_stream/i2s_stream.c:151:9: warning: 'dma_buf_len' is deprecated [-Wdeprecated-declarations]
      151 |         audio_element_output(self, (char *)buf, i2s->config.i2s_config.dma_buf_len * 4);
          |         ^~~~~~~~~~~~~~~~~~~~
    /opt/esp/idf/components/driver/deprecated/driver/i2s_types_legacy.h:229:13: note: declared here
      229 |         int dma_buf_len __attribute__((deprecated));    /*!< This is an alias to 'dma_frame_num' for backward compatibility */
          |             ^~~~~~~~~~~

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Fix the following warnings when building with ESP-IDF >= 5.1.

Building C object esp-idf/esp_peripherals/CMakeFiles/__idf_esp_peripherals.dir/lib/sdcard/sdcard.c.obj/willow/deps/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c: In function 'sdcard_unmount':
/willow/deps/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:168:5: warning: 'esp_vfs_fat_sdmmc_unmount' is deprecated: Please use esp_vfs_fat_sdcard_unmount instead [-Wdeprecated-declarations]
  168 |     esp_err_t ret = esp_vfs_fat_sdmmc_unmount();
      |     ^~~~~~~~~
In file included from /willow/deps/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:32:
/opt/esp/idf/components/fatfs/vfs/esp_vfs_fat.h:197:11: note: declared here
  197 | esp_err_t esp_vfs_fat_sdmmc_unmount(void) __attribute__((deprecated("Please use esp_vfs_fat_sdcard_unmount instead")));
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
@jason-mao
Copy link
Collaborator

@stintel Thank you for your contributions. We separate the I2S by different IDF versions. And we are writing a new i2s_stream_v5.x file for IDF v5.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants