Fix compile errors on ESP32-C6 with latest ESP-IDF (#6822)

* Use <cinttypes> PRI macros to fix ESP32-C6 compile

* Fix compile error on latest ESP-IDF framework & platform
This commit is contained in:
DAVe3283
2024-05-28 13:40:34 -06:00
committed by GitHub
parent 497cf8742f
commit db6f6f0cb7
11 changed files with 73 additions and 56 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "esphome/components/i2c/i2c.h"
#include <cinttypes>
namespace esphome {
namespace xgzp68xx {
@@ -37,8 +38,8 @@ void XGZP68XXComponent::update() {
temperature_raw = encode_uint16(data[3], data[4]);
// Convert the pressure data to hPa
ESP_LOGV(TAG, "Got raw pressure=%d, raw temperature=%d ", pressure_raw, temperature_raw);
ESP_LOGV(TAG, "K value is %d ", this->k_value_);
ESP_LOGV(TAG, "Got raw pressure=%" PRIu32 ", raw temperature=%u", pressure_raw, temperature_raw);
ESP_LOGV(TAG, "K value is %u", this->k_value_);
// The most significant bit of both pressure and temperature will be 1 to indicate a negative value.
// This is directly from the datasheet, and the calculations below will handle this.