mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	Make SPI compile with IDF >= 5.0 (#6383)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
#include "spi_device.h"
 | 
			
		||||
#include "esphome/core/log.h"
 | 
			
		||||
#include "esphome/core/hal.h"
 | 
			
		||||
#include <cinttypes>
 | 
			
		||||
 | 
			
		||||
namespace esphome {
 | 
			
		||||
namespace spi_device {
 | 
			
		||||
@@ -18,9 +19,9 @@ void SPIDeviceComponent::dump_config() {
 | 
			
		||||
  LOG_PIN("  CS pin: ", this->cs_);
 | 
			
		||||
  ESP_LOGCONFIG(TAG, "  Mode: %d", this->mode_);
 | 
			
		||||
  if (this->data_rate_ < 1000000) {
 | 
			
		||||
    ESP_LOGCONFIG(TAG, "  Data rate: %dkHz", this->data_rate_ / 1000);
 | 
			
		||||
    ESP_LOGCONFIG(TAG, "  Data rate: %" PRId32 "kHz", this->data_rate_ / 1000);
 | 
			
		||||
  } else {
 | 
			
		||||
    ESP_LOGCONFIG(TAG, "  Data rate: %dMHz", this->data_rate_ / 1000000);
 | 
			
		||||
    ESP_LOGCONFIG(TAG, "  Data rate: %" PRId32 "MHz", this->data_rate_ / 1000000);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user