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] deprecated functions warnings for logger component with ESP IDF version 5.3.0+ #7600

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

rvalitov
Copy link
Contributor

What does this implement/fix?

Fixes compilation warnings for ESP IDF version 5.3.0+:

src/esphome/components/logger/logger_esp32.cpp: In function 'void esphome::logger::init_usb_serial_jtag_()':
src/esphome/components/logger/logger_esp32.cpp:40:50: warning: 'void esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(esp_line_endings_t)' is deprecated: Please use usb_serial_jtag_vfs_set_rx_line_endings instead [-Wdeprecated-declarations]
   40 |   esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome/components/logger/logger_esp32.cpp:14:
.platformio/packages/framework-espidf/components/vfs/include/esp_vfs_usb_serial_jtag.h:19:6: note: declared here
   19 | void esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(esp_line_endings_t mode) __attribute__((deprecated("Please use usb_serial_jtag_vfs_set_rx_line_endings instead")));
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/logger/logger_esp32.cpp:42:50: warning: 'void esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(esp_line_endings_t)' is deprecated: Please use usb_serial_jtag_vfs_set_tx_line_endings instead [-Wdeprecated-declarations]
   42 |   esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
.platformio/packages/framework-espidf/components/vfs/include/esp_vfs_usb_serial_jtag.h:21:6: note: declared here
   21 | void esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(esp_line_endings_t mode) __attribute__((deprecated("Please use usb_serial_jtag_vfs_set_tx_line_endings instead")));
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/logger/logger_esp32.cpp:60:37: warning: 'void esp_vfs_usb_serial_jtag_use_driver()' is deprecated: Please use usb_serial_jtag_vfs_use_driver() instead [-Wdeprecated-declarations]
   60 |   esp_vfs_usb_serial_jtag_use_driver();
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from src/esphome/components/logger/logger_esp32.cpp:13:
.platformio/packages/framework-espidf/components/vfs/include/esp_vfs_dev.h:63:6: note: declared here
   63 | void esp_vfs_usb_serial_jtag_use_driver(void) __attribute__((deprecated("Please use usb_serial_jtag_vfs_use_driver() instead")));

I would like to resolve this issue to support newer ESP32 boards that require a newer version of ESP IDF other than officially supported by ESPHome.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/issues#6325

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml
esphome:
  name: esphome
  friendly_name: ESPHome
  platformio_options:
    board_build.flash_mode: dio 

esp32:
  board: esp32-c6-devkitc-1
  variant: ESP32C6
  flash_size: 8MB
  framework:
    type: esp-idf
    version: 5.3.1
    platform_version: 6.9.0
    sdkconfig_options:
      CONFIG_ESPTOOLPY_FLASHSIZE_8MB: y
     
# Enable logging
logger:
  level: VERBOSE

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@probot-esphome
Copy link

Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration (logger) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.05%. Comparing base (4d8b5ed) to head (11930fa).
Report is 1451 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7600      +/-   ##
==========================================
+ Coverage   53.70%   54.05%   +0.34%     
==========================================
  Files          50       50              
  Lines        9408     9698     +290     
  Branches     1654     1344     -310     
==========================================
+ Hits         5053     5242     +189     
- Misses       4056     4130      +74     
- Partials      299      326      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jesserockz jesserockz merged commit b274d69 into esphome:dev Oct 16, 2024
27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation warnings for logger component with ESP IDF version 5.3.0+
3 participants