mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 00:31:58 +00:00
[qspi_dbi] Replace format_hex_pretty with stack-based format_hex_pretty_to
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
#if defined(USE_ESP32) && defined(USE_ESP32_VARIANT_ESP32S3)
|
||||
#include "qspi_dbi.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace qspi_dbi {
|
||||
|
||||
// Maximum bytes to log in verbose hex output
|
||||
static constexpr size_t QSPI_DBI_MAX_LOG_BYTES = 64;
|
||||
|
||||
void QspiDbi::setup() {
|
||||
this->spi_setup();
|
||||
if (this->enable_pin_ != nullptr) {
|
||||
@@ -174,7 +178,11 @@ void QspiDbi::write_to_display_(int x_start, int y_start, int w, int h, const ui
|
||||
this->disable();
|
||||
}
|
||||
void QspiDbi::write_command_(uint8_t cmd, const uint8_t *bytes, size_t len) {
|
||||
ESP_LOGV(TAG, "Command %02X, length %d, bytes %s", cmd, len, format_hex_pretty(bytes, len).c_str());
|
||||
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
|
||||
char hex_buf[format_hex_pretty_size(QSPI_DBI_MAX_LOG_BYTES)];
|
||||
#endif
|
||||
ESP_LOGV(TAG, "Command %02X, length %d, bytes %s", cmd, len,
|
||||
format_hex_pretty_to(hex_buf, sizeof(hex_buf), bytes, len));
|
||||
this->enable();
|
||||
this->write_cmd_addr_data(8, 0x02, 24, cmd << 8, bytes, len);
|
||||
this->disable();
|
||||
|
||||
Reference in New Issue
Block a user