mirror of
https://github.com/esphome/esphome.git
synced 2026-09-19 11:08:38 +00:00
[usb_uart] Fix format specifier warnings for uint32_t in ft23xx and pl2303 (#17342)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "esphome/components/uart/uart_debugger.h"
|
||||
|
||||
#include "esphome/components/bytebuffer/bytebuffer.h"
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome::usb_uart {
|
||||
|
||||
@@ -288,16 +289,16 @@ int USBUartTypeFT23XX::set_baudrate_(USBUartChannel *channel, uint32_t baudrate)
|
||||
ESP_LOGE(TAG, "Set baudrate failed, status=%s", esp_err_to_name(status.error_code));
|
||||
channel->initialised_.store(false);
|
||||
} else {
|
||||
ESP_LOGD(TAG, "Baudrate %d set, setting line properties...", channel->baud_rate_);
|
||||
ESP_LOGD(TAG, "Baudrate %" PRIu32 " set, setting line properties...", channel->baud_rate_);
|
||||
this->set_line_properties_(channel);
|
||||
}
|
||||
};
|
||||
if (baudrate == 0) {
|
||||
baudrate = channel->baud_rate_;
|
||||
}
|
||||
uint16_t value, ftdi_index;
|
||||
uint16_t value = 0, ftdi_index = 0;
|
||||
ftdi_convert_baudrate(baudrate, this->chip_type_, channel->index_, &value, &ftdi_index);
|
||||
ESP_LOGD(TAG, "Baudrate: %d, value=0x%04X, ftdi_index=0x%04X", baudrate, value, ftdi_index);
|
||||
ESP_LOGD(TAG, "Baudrate: %" PRIu32 ", value=0x%04X, ftdi_index=0x%04X", baudrate, value, ftdi_index);
|
||||
uint16_t usb_index = (ftdi_index & 0xFF00) | (channel->cdc_dev_.bulk_interface_number + 1);
|
||||
bool ok = this->control_transfer(USB_VENDOR_DEV | usb_host::USB_DIR_OUT, 0x03, value, usb_index, callback);
|
||||
if (!ok) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "usb_uart.h"
|
||||
#include "usb/usb_host.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include <cinttypes>
|
||||
|
||||
namespace esphome::usb_uart {
|
||||
|
||||
@@ -282,8 +283,8 @@ void USBUartTypePL2303::enable_channels() {
|
||||
// Data bits
|
||||
line_coding[6] = channel->get_data_bits();
|
||||
|
||||
ESP_LOGD(TAG, "PL2303: SET_LINE_REQUEST baud=%u stop=%u parity=%u data=%u", baud, line_coding[4], line_coding[5],
|
||||
line_coding[6]);
|
||||
ESP_LOGD(TAG, "PL2303: SET_LINE_REQUEST baud=%" PRIu32 " stop=%u parity=%u data=%u", baud, line_coding[4],
|
||||
line_coding[5], line_coding[6]);
|
||||
|
||||
std::vector<uint8_t> lc_vec(line_coding, line_coding + 7);
|
||||
uint16_t iface = channel->cdc_dev_.bulk_interface_number;
|
||||
|
||||
Reference in New Issue
Block a user