mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
[core] Centralize component setup logging to reduce flash usage (#9885)
This commit is contained in:
parent
2b87589562
commit
b7ce8c116b
@ -7,7 +7,6 @@ namespace a4988 {
|
||||
static const char *const TAG = "a4988.stepper";
|
||||
|
||||
void A4988::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->sleep_pin_ != nullptr) {
|
||||
this->sleep_pin_->setup();
|
||||
this->sleep_pin_->digital_write(false);
|
||||
|
@ -7,8 +7,6 @@ namespace absolute_humidity {
|
||||
static const char *const TAG = "absolute_humidity.sensor";
|
||||
|
||||
void AbsoluteHumidityComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
|
||||
ESP_LOGD(TAG, " Added callback for temperature '%s'", this->temperature_sensor_->get_name().c_str());
|
||||
this->temperature_sensor_->add_on_state_callback([this](float state) { this->temperature_callback_(state); });
|
||||
if (this->temperature_sensor_->has_state()) {
|
||||
|
@ -37,7 +37,6 @@ const LogString *adc_unit_to_str(adc_unit_t unit) {
|
||||
}
|
||||
|
||||
void ADCSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
// Check if another sensor already initialized this ADC unit
|
||||
if (ADCSensor::shared_adc_handles[this->adc_unit_] == nullptr) {
|
||||
adc_oneshot_unit_init_cfg_t init_config = {}; // Zero initialize
|
||||
|
@ -17,7 +17,6 @@ namespace adc {
|
||||
static const char *const TAG = "adc.esp8266";
|
||||
|
||||
void ADCSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
#ifndef USE_ADC_SENSOR_VCC
|
||||
this->pin_->setup();
|
||||
#endif
|
||||
|
@ -9,7 +9,6 @@ namespace adc {
|
||||
static const char *const TAG = "adc.libretiny";
|
||||
|
||||
void ADCSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
#ifndef USE_ADC_SENSOR_VCC
|
||||
this->pin_->setup();
|
||||
#endif // !USE_ADC_SENSOR_VCC
|
||||
|
@ -14,7 +14,6 @@ namespace adc {
|
||||
static const char *const TAG = "adc.rp2040";
|
||||
|
||||
void ADCSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
adc_init();
|
||||
|
@ -8,10 +8,7 @@ static const char *const TAG = "adc128s102";
|
||||
|
||||
float ADC128S102::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
|
||||
void ADC128S102::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->spi_setup();
|
||||
}
|
||||
void ADC128S102::setup() { this->spi_setup(); }
|
||||
|
||||
void ADC128S102::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "ADC128S102:");
|
||||
|
@ -10,7 +10,6 @@ static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00;
|
||||
static const uint8_t ADS1115_REGISTER_CONFIG = 0x01;
|
||||
|
||||
void ADS1115Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint16_t value;
|
||||
if (!this->read_byte_16(ADS1115_REGISTER_CONVERSION, &value)) {
|
||||
this->mark_failed();
|
||||
|
@ -9,7 +9,6 @@ static const char *const TAG = "ads1118";
|
||||
static const uint8_t ADS1118_DATA_RATE_860_SPS = 0b111;
|
||||
|
||||
void ADS1118::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->spi_setup();
|
||||
|
||||
this->config_ = 0;
|
||||
|
@ -24,8 +24,6 @@ static const uint16_t ZP_CURRENT = 0x0000;
|
||||
static const uint16_t ZP_DEFAULT = 0xFFFF;
|
||||
|
||||
void AGS10Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
auto version = this->read_version_();
|
||||
if (version) {
|
||||
ESP_LOGD(TAG, "AGS10 Sensor Version: 0x%02X", *version);
|
||||
@ -45,8 +43,6 @@ void AGS10Component::setup() {
|
||||
} else {
|
||||
ESP_LOGE(TAG, "AGS10 Sensor Resistance: unknown");
|
||||
}
|
||||
|
||||
ESP_LOGD(TAG, "Sensor initialized");
|
||||
}
|
||||
|
||||
void AGS10Component::update() {
|
||||
|
@ -38,8 +38,6 @@ static const uint8_t AHT10_STATUS_BUSY = 0x80;
|
||||
static const float AHT10_DIVISOR = 1048576.0f; // 2^20, used for temperature and humidity calculations
|
||||
|
||||
void AHT10Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (this->write(AHT10_SOFTRESET_CMD, sizeof(AHT10_SOFTRESET_CMD)) != i2c::ERROR_OK) {
|
||||
ESP_LOGE(TAG, "Reset failed");
|
||||
}
|
||||
@ -80,8 +78,6 @@ void AHT10Component::setup() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGV(TAG, "Initialization complete");
|
||||
}
|
||||
|
||||
void AHT10Component::restart_read_() {
|
||||
|
@ -17,8 +17,6 @@ static const char *const TAG = "aic3204";
|
||||
}
|
||||
|
||||
void AIC3204::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// Set register page to 0
|
||||
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x00), "Set page 0 failed");
|
||||
// Initiate SW reset (PLL is powered off as part of reset)
|
||||
|
@ -90,8 +90,6 @@ bool AM2315C::convert_(uint8_t *data, float &humidity, float &temperature) {
|
||||
}
|
||||
|
||||
void AM2315C::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// get status
|
||||
uint8_t status = 0;
|
||||
if (this->read(&status, 1) != i2c::ERROR_OK) {
|
||||
|
@ -34,7 +34,6 @@ void AM2320Component::update() {
|
||||
this->status_clear_warning();
|
||||
}
|
||||
void AM2320Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t data[8];
|
||||
data[0] = 0;
|
||||
data[1] = 4;
|
||||
|
@ -54,8 +54,6 @@ enum { // APDS9306 registers
|
||||
}
|
||||
|
||||
void APDS9306::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
uint8_t id;
|
||||
if (!this->read_byte(APDS9306_PART_ID, &id)) { // Part ID register
|
||||
this->error_code_ = COMMUNICATION_FAILED;
|
||||
@ -86,8 +84,6 @@ void APDS9306::setup() {
|
||||
|
||||
// Set to active mode
|
||||
APDS9306_WRITE_BYTE(APDS9306_MAIN_CTRL, 0x02);
|
||||
|
||||
ESP_LOGCONFIG(TAG, "APDS9306 setup complete");
|
||||
}
|
||||
|
||||
void APDS9306::dump_config() {
|
||||
|
@ -15,7 +15,6 @@ static const char *const TAG = "apds9960";
|
||||
#define APDS9960_WRITE_BYTE(reg, value) APDS9960_ERROR_CHECK(this->write_byte(reg, value));
|
||||
|
||||
void APDS9960::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t id;
|
||||
if (!this->read_byte(0x92, &id)) { // ID register
|
||||
this->error_code_ = COMMUNICATION_FAILED;
|
||||
|
@ -7,8 +7,6 @@ namespace as3935 {
|
||||
static const char *const TAG = "as3935";
|
||||
|
||||
void AS3935Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
this->irq_pin_->setup();
|
||||
LOG_PIN(" IRQ Pin: ", this->irq_pin_);
|
||||
|
||||
|
@ -7,9 +7,7 @@ namespace as3935_spi {
|
||||
static const char *const TAG = "as3935_spi";
|
||||
|
||||
void SPIAS3935Component::setup() {
|
||||
ESP_LOGI(TAG, "SPIAS3935Component setup started!");
|
||||
this->spi_setup();
|
||||
ESP_LOGI(TAG, "SPI setup finished!");
|
||||
AS3935Component::setup();
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,6 @@ static const uint8_t REGISTER_AGC = 0x1A; // 8 bytes / R
|
||||
static const uint8_t REGISTER_MAGNITUDE = 0x1B; // 16 bytes / R
|
||||
|
||||
void AS5600Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (!this->read_byte(REGISTER_STATUS).has_value()) {
|
||||
this->mark_failed();
|
||||
return;
|
||||
|
@ -8,7 +8,6 @@ namespace as7341 {
|
||||
static const char *const TAG = "as7341";
|
||||
|
||||
void AS7341Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
LOG_I2C_DEVICE(this);
|
||||
|
||||
// Verify device ID
|
||||
|
@ -71,7 +71,7 @@ bool AT581XComponent::i2c_read_reg(uint8_t addr, uint8_t &data) {
|
||||
return this->read_register(addr, &data, 1) == esphome::i2c::NO_ERROR;
|
||||
}
|
||||
|
||||
void AT581XComponent::setup() { ESP_LOGCONFIG(TAG, "Running setup"); }
|
||||
void AT581XComponent::setup() {}
|
||||
void AT581XComponent::dump_config() { LOG_I2C_DEVICE(this); }
|
||||
#define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
|
||||
bool AT581XComponent::i2c_write_config() {
|
||||
|
@ -41,7 +41,6 @@ void ATM90E26Component::update() {
|
||||
}
|
||||
|
||||
void ATM90E26Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->spi_setup();
|
||||
|
||||
uint16_t mmode = 0x422; // default values for everything but L/N line current gains
|
||||
|
@ -109,7 +109,6 @@ void ATM90E32Component::update() {
|
||||
}
|
||||
|
||||
void ATM90E32Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->spi_setup();
|
||||
|
||||
uint16_t mmode0 = 0x87; // 3P4W 50Hz
|
||||
|
@ -17,7 +17,6 @@ constexpr static const uint8_t AXS_READ_TOUCHPAD[11] = {0xb5, 0xab, 0xa5, 0x5a,
|
||||
}
|
||||
|
||||
void AXS15231Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
this->reset_pin_->setup();
|
||||
this->reset_pin_->digital_write(false);
|
||||
@ -36,7 +35,6 @@ void AXS15231Touchscreen::setup() {
|
||||
if (this->y_raw_max_ == 0) {
|
||||
this->y_raw_max_ = this->display_->get_native_height();
|
||||
}
|
||||
ESP_LOGCONFIG(TAG, "AXS15231 Touchscreen setup complete");
|
||||
}
|
||||
|
||||
void AXS15231Touchscreen::update_touches() {
|
||||
|
@ -121,8 +121,6 @@ void spi_dma_tx_finish_callback(unsigned int param) {
|
||||
}
|
||||
|
||||
void BekenSPILEDStripLightOutput::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
size_t buffer_size = this->get_buffer_size_();
|
||||
size_t dma_buffer_size = (buffer_size * 8) + (2 * 64);
|
||||
|
||||
|
@ -38,7 +38,6 @@ MTreg:
|
||||
*/
|
||||
|
||||
void BH1750Sensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->name_.c_str());
|
||||
uint8_t turn_on = BH1750_COMMAND_POWER_ON;
|
||||
if (this->write(&turn_on, 1) != i2c::ERROR_OK) {
|
||||
this->mark_failed();
|
||||
|
@ -88,7 +88,6 @@ const char *oversampling_to_str(BME280Oversampling oversampling) { // NOLINT
|
||||
}
|
||||
|
||||
void BME280Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t chip_id = 0;
|
||||
|
||||
// Mark as not failed before initializing. Some devices will turn off sensors to save on batteries
|
||||
|
@ -71,7 +71,6 @@ static const char *iir_filter_to_str(BME680IIRFilter filter) {
|
||||
}
|
||||
|
||||
void BME680Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t chip_id;
|
||||
if (!this->read_byte(BME680_REGISTER_CHIPID, &chip_id) || chip_id != 0x61) {
|
||||
this->mark_failed();
|
||||
|
@ -15,8 +15,6 @@ std::vector<BME680BSECComponent *>
|
||||
uint8_t BME680BSECComponent::work_buffer_[BSEC_MAX_WORKBUFFER_SIZE] = {0};
|
||||
|
||||
void BME680BSECComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->device_id_.c_str());
|
||||
|
||||
uint8_t new_idx = BME680BSECComponent::instances.size();
|
||||
BME680BSECComponent::instances.push_back(this);
|
||||
|
||||
|
@ -21,8 +21,6 @@ static const char *const TAG = "bme68x_bsec2.sensor";
|
||||
static const std::string IAQ_ACCURACY_STATES[4] = {"Stabilizing", "Uncertain", "Calibrating", "Calibrated"};
|
||||
|
||||
void BME68xBSEC2Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
this->bsec_status_ = bsec_init_m(&this->bsec_instance_);
|
||||
if (this->bsec_status_ != BSEC_OK) {
|
||||
this->mark_failed();
|
||||
|
@ -119,7 +119,6 @@ const float GRAVITY_EARTH = 9.80665f;
|
||||
void BMI160Component::internal_setup_(int stage) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t chipid;
|
||||
if (!this->read_byte(BMI160_REGISTER_CHIPID, &chipid) || (chipid != 0b11010001)) {
|
||||
this->mark_failed();
|
||||
|
@ -20,7 +20,6 @@ void BMP085Component::update() {
|
||||
this->set_timeout("temperature", 5, [this]() { this->read_temperature_(); });
|
||||
}
|
||||
void BMP085Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t data[22];
|
||||
if (!this->read_bytes(BMP085_REGISTER_AC1_H, data, 22)) {
|
||||
this->mark_failed();
|
||||
|
@ -57,7 +57,6 @@ static const char *iir_filter_to_str(BMP280IIRFilter filter) {
|
||||
}
|
||||
|
||||
void BMP280Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t chip_id = 0;
|
||||
|
||||
// Read the chip id twice, to work around a bug where the first read is 0.
|
||||
|
@ -70,7 +70,6 @@ static const LogString *iir_filter_to_str(IIRFilter filter) {
|
||||
|
||||
void BMP3XXComponent::setup() {
|
||||
this->error_code_ = NONE;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// Call the Device base class "initialise" function
|
||||
if (!reset()) {
|
||||
ESP_LOGE(TAG, "Failed to reset");
|
||||
|
@ -128,8 +128,6 @@ void BMP581Component::setup() {
|
||||
*/
|
||||
|
||||
this->error_code_ = NONE;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
////////////////////
|
||||
// 1) Soft reboot //
|
||||
////////////////////
|
||||
|
@ -15,7 +15,6 @@ static const uint8_t BP1658CJ_ADDR_START_5CH = 0x30;
|
||||
static const uint8_t BP1658CJ_DELAY = 2;
|
||||
|
||||
void BP1658CJ::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->data_pin_->setup();
|
||||
this->data_pin_->digital_write(false);
|
||||
this->clock_pin_->setup();
|
||||
|
@ -20,7 +20,6 @@ static const uint8_t BP5758D_ALL_DATA_CHANNEL_ENABLEMENT = 0b00011111;
|
||||
static const uint8_t BP5758D_DELAY = 2;
|
||||
|
||||
void BP5758D::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->data_pin_->setup();
|
||||
this->data_pin_->digital_write(false);
|
||||
delayMicroseconds(BP5758D_DELAY);
|
||||
|
@ -7,7 +7,6 @@ namespace canbus {
|
||||
static const char *const TAG = "canbus";
|
||||
|
||||
void Canbus::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (!this->setup_internal()) {
|
||||
ESP_LOGE(TAG, "setup error!");
|
||||
this->mark_failed();
|
||||
|
@ -8,8 +8,6 @@ namespace cap1188 {
|
||||
static const char *const TAG = "cap1188";
|
||||
|
||||
void CAP1188Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// Reset device using the reset pin
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
this->reset_pin_->setup();
|
||||
|
@ -10,8 +10,6 @@ static const char *const TAG = "cd74hc4067";
|
||||
float CD74HC4067Component::get_setup_priority() const { return setup_priority::DATA; }
|
||||
|
||||
void CD74HC4067Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
this->pin_s0_->setup();
|
||||
this->pin_s1_->setup();
|
||||
this->pin_s2_->setup();
|
||||
|
@ -14,7 +14,6 @@ static const uint8_t CH422G_REG_OUT_UPPER = 0x23; // write reg for output bit
|
||||
static const char *const TAG = "ch422g";
|
||||
|
||||
void CH422GComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// set outputs before mode
|
||||
this->write_outputs_();
|
||||
// Set mode and check for errors
|
||||
|
@ -4,7 +4,6 @@ namespace esphome {
|
||||
namespace chsc6x {
|
||||
|
||||
void CHSC6XTouchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->interrupt_pin_ != nullptr) {
|
||||
this->interrupt_pin_->setup();
|
||||
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE);
|
||||
@ -15,8 +14,6 @@ void CHSC6XTouchscreen::setup() {
|
||||
if (this->y_raw_max_ == this->y_raw_min_) {
|
||||
this->y_raw_max_ = this->display_->get_native_height();
|
||||
}
|
||||
|
||||
ESP_LOGCONFIG(TAG, "CHSC6X Touchscreen setup complete");
|
||||
}
|
||||
|
||||
void CHSC6XTouchscreen::update_touches() {
|
||||
|
@ -20,7 +20,6 @@ uint8_t cm1106_checksum(const uint8_t *response, size_t len) {
|
||||
}
|
||||
|
||||
void CM1106Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t response[8] = {0};
|
||||
if (!this->cm1106_write_command_(C_M1106_CMD_GET_CO2, sizeof(C_M1106_CMD_GET_CO2), response, sizeof(response))) {
|
||||
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||
|
@ -52,8 +52,6 @@ bool CS5460AComponent::softreset_() {
|
||||
}
|
||||
|
||||
void CS5460AComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
float current_full_scale = (pga_gain_ == CS5460A_PGA_GAIN_10X) ? 0.25 : 0.10;
|
||||
float voltage_full_scale = 0.25;
|
||||
current_multiplier_ = current_full_scale / (fabsf(current_gain_) * 0x1000000);
|
||||
|
@ -42,7 +42,6 @@ static const uint8_t CSE7761_CMD_ENABLE_WRITE = 0xE5; // Enable write operation
|
||||
enum CSE7761 { RMS_IAC, RMS_IBC, RMS_UC, POWER_PAC, POWER_PBC, POWER_SC, ENERGY_AC, ENERGY_BC };
|
||||
|
||||
void CSE7761Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->write_(CSE7761_SPECIAL_COMMAND, CSE7761_CMD_RESET);
|
||||
uint16_t syscon = this->read_(0x00, 2); // Default 0x0A04
|
||||
if ((0x0A04 == syscon) && this->chip_init_()) {
|
||||
|
@ -6,7 +6,6 @@ namespace cst226 {
|
||||
static const char *const TAG = "cst226.touchscreen";
|
||||
|
||||
void CST226Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
this->reset_pin_->setup();
|
||||
this->reset_pin_->digital_write(true);
|
||||
@ -95,7 +94,6 @@ void CST226Touchscreen::continue_setup_() {
|
||||
}
|
||||
}
|
||||
this->setup_complete_ = true;
|
||||
ESP_LOGCONFIG(TAG, "CST226 Touchscreen setup complete");
|
||||
}
|
||||
void CST226Touchscreen::update_button_state_(bool state) {
|
||||
if (this->button_touched_ == state)
|
||||
|
@ -35,11 +35,9 @@ void CST816Touchscreen::continue_setup_() {
|
||||
if (this->y_raw_max_ == this->y_raw_min_) {
|
||||
this->y_raw_max_ = this->display_->get_native_height();
|
||||
}
|
||||
ESP_LOGCONFIG(TAG, "CST816 Touchscreen setup complete");
|
||||
}
|
||||
|
||||
void CST816Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
this->reset_pin_->setup();
|
||||
this->reset_pin_->digital_write(true);
|
||||
|
@ -20,8 +20,6 @@ static const uint8_t DAC7678_REG_INTERNAL_REF_0 = 0x80;
|
||||
static const uint8_t DAC7678_REG_INTERNAL_REF_1 = 0x90;
|
||||
|
||||
void DAC7678Output::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
ESP_LOGV(TAG, "Resetting device");
|
||||
|
||||
// Reset device
|
||||
|
@ -70,7 +70,6 @@ bool DallasTemperatureSensor::read_scratch_pad_() {
|
||||
}
|
||||
|
||||
void DallasTemperatureSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (!this->check_address_())
|
||||
return;
|
||||
if (!this->read_scratch_pad_())
|
||||
|
@ -12,7 +12,6 @@ static const uint32_t TEARDOWN_TIMEOUT_DEEP_SLEEP_MS = 5000;
|
||||
bool global_has_deep_sleep = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
void DeepSleepComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
global_has_deep_sleep = true;
|
||||
|
||||
const optional<uint32_t> run_duration = get_run_duration_();
|
||||
|
@ -8,7 +8,6 @@ namespace dht {
|
||||
static const char *const TAG = "dht";
|
||||
|
||||
void DHT::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->pin_->digital_write(true);
|
||||
this->pin_->setup();
|
||||
this->pin_->digital_write(true);
|
||||
|
@ -34,7 +34,6 @@ void DHT12Component::update() {
|
||||
this->status_clear_warning();
|
||||
}
|
||||
void DHT12Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t data[5];
|
||||
if (!this->read_data_(data)) {
|
||||
this->mark_failed();
|
||||
|
@ -11,8 +11,6 @@ void DPS310Component::setup() {
|
||||
uint8_t coef_data_raw[DPS310_NUM_COEF_REGS];
|
||||
auto timer = DPS310_INIT_TIMEOUT;
|
||||
uint8_t reg = 0;
|
||||
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// first, reset the sensor
|
||||
if (!this->write_byte(DPS310_REG_RESET, DPS310_CMD_RESET)) {
|
||||
this->mark_failed();
|
||||
|
@ -10,7 +10,6 @@ namespace ds1307 {
|
||||
static const char *const TAG = "ds1307";
|
||||
|
||||
void DS1307Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (!this->read_rtc_()) {
|
||||
this->mark_failed();
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace ds2484 {
|
||||
static const char *const TAG = "ds2484.onewire";
|
||||
|
||||
void DS2484OneWireBus::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->reset_device();
|
||||
this->search();
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ namespace duty_cycle {
|
||||
static const char *const TAG = "duty_cycle";
|
||||
|
||||
void DutyCycleSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||
this->pin_->setup();
|
||||
this->store_.pin = this->pin_->to_isr();
|
||||
this->store_.last_level = this->pin_->digital_read();
|
||||
|
@ -16,7 +16,6 @@ static const uint16_t PRESSURE_ADDRESS = 0x04B0;
|
||||
|
||||
void EE895Component::setup() {
|
||||
uint16_t crc16_check = 0;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
write_command_(SERIAL_NUMBER, 8);
|
||||
uint8_t serial_number[20];
|
||||
this->read(serial_number, 20);
|
||||
|
@ -16,7 +16,6 @@ static const uint8_t GET_Y_RES[4] = {0x53, 0x63, 0x00, 0x00};
|
||||
static const uint8_t GET_POWER_STATE_CMD[4] = {0x53, 0x50, 0x00, 0x01};
|
||||
|
||||
void EKTF2232Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->interrupt_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||
this->interrupt_pin_->setup();
|
||||
|
||||
|
@ -57,8 +57,6 @@ static const uint8_t EMC2101_POLARITY_BIT = 1 << 4;
|
||||
float Emc2101Component::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
|
||||
void Emc2101Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// make sure we're talking to the right chip
|
||||
uint8_t chip_id = reg(EMC2101_REGISTER_WHOAMI).get();
|
||||
if ((chip_id != EMC2101_CHIP_ID) && (chip_id != EMC2101_ALT_CHIP_ID)) {
|
||||
|
@ -49,8 +49,6 @@ static const uint8_t ENS160_DATA_STATUS_NEWGPR = 0x01;
|
||||
static const uint8_t ENS160_DATA_AQI = 0x07;
|
||||
|
||||
void ENS160Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// check part_id
|
||||
uint16_t part_id;
|
||||
if (!this->read_bytes(ENS160_REG_PART_ID, reinterpret_cast<uint8_t *>(&part_id), 2)) {
|
||||
|
@ -87,7 +87,6 @@ static uint32_t crc7(uint32_t value) {
|
||||
}
|
||||
|
||||
void ENS210Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t data[2];
|
||||
uint16_t part_id = 0;
|
||||
// Reset
|
||||
|
@ -38,8 +38,6 @@ void ES7210::dump_config() {
|
||||
}
|
||||
|
||||
void ES7210::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// Software reset
|
||||
ES7210_ERROR_FAILED(this->write_byte(ES7210_RESET_REG00, 0xff));
|
||||
ES7210_ERROR_FAILED(this->write_byte(ES7210_RESET_REG00, 0x32));
|
||||
|
@ -34,8 +34,6 @@ void ES7243E::dump_config() {
|
||||
}
|
||||
|
||||
void ES7243E::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
ES7243E_ERROR_FAILED(this->write_byte(ES7243E_CLOCK_MGR_REG01, 0x3A));
|
||||
ES7243E_ERROR_FAILED(this->write_byte(ES7243E_RESET_REG00, 0x80));
|
||||
ES7243E_ERROR_FAILED(this->write_byte(ES7243E_TEST_MODE_REGF9, 0x00));
|
||||
|
@ -17,8 +17,6 @@ static const char *const TAG = "es8156";
|
||||
}
|
||||
|
||||
void ES8156::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
ES8156_ERROR_FAILED(this->write_byte(ES8156_REG02_SCLK_MODE, 0x04));
|
||||
ES8156_ERROR_FAILED(this->write_byte(ES8156_REG20_ANALOG_SYS1, 0x2A));
|
||||
ES8156_ERROR_FAILED(this->write_byte(ES8156_REG21_ANALOG_SYS2, 0x3C));
|
||||
|
@ -22,8 +22,6 @@ static const char *const TAG = "es8311";
|
||||
}
|
||||
|
||||
void ES8311::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// Reset
|
||||
ES8311_ERROR_FAILED(this->write_byte(ES8311_REG00_RESET, 0x1F));
|
||||
ES8311_ERROR_FAILED(this->write_byte(ES8311_REG00_RESET, 0x00));
|
||||
|
@ -23,8 +23,6 @@ static const char *const TAG = "es8388";
|
||||
}
|
||||
|
||||
void ES8388::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
// mute DAC
|
||||
this->set_mute_state_(true);
|
||||
|
||||
|
@ -25,8 +25,6 @@ static const char *const TAG = "esp32_ble";
|
||||
|
||||
void ESP32BLE::setup() {
|
||||
global_ble = this;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (!ble_pre_setup_()) {
|
||||
ESP_LOGE(TAG, "BLE could not be prepared for configuration");
|
||||
this->mark_failed();
|
||||
|
@ -20,7 +20,6 @@ static constexpr uint8_t DAC0_PIN = 25;
|
||||
static const char *const TAG = "esp32_dac";
|
||||
|
||||
void ESP32DAC::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->pin_->setup();
|
||||
this->turn_off();
|
||||
|
||||
|
@ -59,8 +59,6 @@ static size_t IRAM_ATTR HOT encoder_callback(const void *data, size_t size, size
|
||||
#endif
|
||||
|
||||
void ESP32RMTLEDStripLightOutput::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
size_t buffer_size = this->get_buffer_size_();
|
||||
|
||||
RAMAllocator<uint8_t> allocator(this->use_psram_ ? 0 : RAMAllocator<uint8_t>::ALLOC_INTERNAL);
|
||||
|
@ -14,7 +14,6 @@ namespace esp8266_pwm {
|
||||
static const char *const TAG = "esp8266_pwm";
|
||||
|
||||
void ESP8266PWM::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->pin_->setup();
|
||||
this->turn_off();
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ EthernetComponent *global_eth_component; // NOLINT(cppcoreguidelines-avoid-non-
|
||||
EthernetComponent::EthernetComponent() { global_eth_component = this; }
|
||||
|
||||
void EthernetComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (esp_reset_reason() != ESP_RST_DEEPSLEEP) {
|
||||
// Delay here to allow power to stabilise before Ethernet is initialized.
|
||||
delay(300); // NOLINT
|
||||
|
@ -9,7 +9,6 @@ namespace fastled_base {
|
||||
static const char *const TAG = "fastled";
|
||||
|
||||
void FastLEDLightOutput::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->controller_->init();
|
||||
this->controller_->setLeds(this->leds_, this->num_leds_);
|
||||
this->effect_data_ = new uint8_t[this->num_leds_]; // NOLINT
|
||||
|
@ -57,8 +57,6 @@ void FingerprintGrowComponent::update() {
|
||||
}
|
||||
|
||||
void FingerprintGrowComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
this->has_sensing_pin_ = (this->sensing_pin_ != nullptr);
|
||||
this->has_power_pin_ = (this->sensor_power_pin_ != nullptr);
|
||||
|
||||
|
@ -7,8 +7,6 @@ namespace fs3000 {
|
||||
static const char *const TAG = "fs3000";
|
||||
|
||||
void FS3000Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (model_ == FIVE) {
|
||||
// datasheet gives 9 points to interpolate from for the 1005 model
|
||||
static const uint16_t RAW_DATA_POINTS_1005[9] = {409, 915, 1522, 2066, 2523, 2908, 3256, 3572, 3686};
|
||||
|
@ -9,7 +9,6 @@ namespace ft5x06 {
|
||||
static const char *const TAG = "ft5x06.touchscreen";
|
||||
|
||||
void FT5x06Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->interrupt_pin_ != nullptr) {
|
||||
this->interrupt_pin_->setup();
|
||||
this->interrupt_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||
@ -50,7 +49,6 @@ void FT5x06Touchscreen::continue_setup_() {
|
||||
this->y_raw_max_ = this->display_->get_native_height();
|
||||
}
|
||||
}
|
||||
ESP_LOGCONFIG(TAG, "FT5x06 Touchscreen setup complete");
|
||||
}
|
||||
|
||||
void FT5x06Touchscreen::update_touches() {
|
||||
|
@ -28,7 +28,6 @@ static const uint8_t FT63X6_ADDR_CHIP_ID = 0xA3;
|
||||
static const char *const TAG = "FT63X6";
|
||||
|
||||
void FT63X6Touchscreen::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->interrupt_pin_ != nullptr) {
|
||||
this->interrupt_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||
this->interrupt_pin_->setup();
|
||||
|
@ -34,7 +34,6 @@ void GDK101Component::update() {
|
||||
|
||||
void GDK101Component::setup() {
|
||||
uint8_t data[2];
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// first, reset the sensor
|
||||
if (!this->reset_sensor_(data)) {
|
||||
this->status_set_error("Reset failed!");
|
||||
|
@ -17,7 +17,6 @@ static const uint8_t RESTART_CMD2 = 0xA5;
|
||||
static const uint8_t READ_DELAY = 40; // minimum milliseconds from datasheet to safely read measurement result
|
||||
|
||||
void GLR01I2CComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Setting up GL-R01 I2C...");
|
||||
// Verify sensor presence
|
||||
if (!this->read_byte_16(REG_VERSION, &this->version_)) {
|
||||
ESP_LOGE(TAG, "Failed to communicate with GL-R01 I2C sensor!");
|
||||
|
@ -8,7 +8,6 @@ namespace gpio {
|
||||
static const char *const TAG = "gpio.one_wire";
|
||||
|
||||
void GPIOOneWireBus::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->t_pin_->setup();
|
||||
this->t_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
|
||||
// clear bus with 480µs high, otherwise initial reset in search might fail
|
||||
|
@ -8,8 +8,6 @@ static const char *const TAG = "switch.gpio";
|
||||
|
||||
float GPIOSwitch::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
void GPIOSwitch::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->name_.c_str());
|
||||
|
||||
bool initial_state = this->get_initial_state_with_restore_mode().value_or(false);
|
||||
|
||||
// write state before setup
|
||||
|
@ -33,7 +33,6 @@ bool GroveGasMultichannelV2Component::read_sensor_(uint8_t address, sensor::Sens
|
||||
}
|
||||
|
||||
void GroveGasMultichannelV2Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// Before reading sensor values, must preheat sensor
|
||||
if (!(this->write_bytes(GROVE_GAS_MC_V2_HEAT_ON, {}))) {
|
||||
this->mark_failed();
|
||||
|
@ -24,7 +24,6 @@ void GroveMotorDriveTB6612FNG::dump_config() {
|
||||
}
|
||||
|
||||
void GroveMotorDriveTB6612FNG::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (!this->standby()) {
|
||||
this->mark_failed();
|
||||
return;
|
||||
|
@ -26,7 +26,6 @@ static const size_t MAX_BUTTONS = 4; // max number of buttons scanned
|
||||
|
||||
void GT911Touchscreen::setup() {
|
||||
i2c::ErrorCode err;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (this->reset_pin_ != nullptr) {
|
||||
this->reset_pin_->setup();
|
||||
this->reset_pin_->digital_write(false);
|
||||
@ -83,8 +82,6 @@ void GT911Touchscreen::setup() {
|
||||
if (err != i2c::ERROR_OK) {
|
||||
this->mark_failed("Failed to communicate");
|
||||
}
|
||||
|
||||
ESP_LOGCONFIG(TAG, "GT911 Touchscreen setup complete");
|
||||
}
|
||||
|
||||
void GT911Touchscreen::update_touches() {
|
||||
|
@ -242,7 +242,6 @@ haier_protocol::HandlerError HaierClimateBase::timeout_default_handler_(haier_pr
|
||||
}
|
||||
|
||||
void HaierClimateBase::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
// Set timestamp here to give AC time to boot
|
||||
this->last_request_timestamp_ = std::chrono::steady_clock::now();
|
||||
this->set_phase(ProtocolPhases::SENDING_INIT_1);
|
||||
|
@ -10,8 +10,6 @@ static const char *const TAG = "switch.hbridge";
|
||||
|
||||
float HBridgeSwitch::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
void HBridgeSwitch::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->name_.c_str());
|
||||
|
||||
optional<bool> initial_state = this->get_initial_state_with_restore_mode();
|
||||
|
||||
// Like GPIOSwitch does, set the pin state both before and after pin setup()
|
||||
|
@ -13,8 +13,6 @@ static const uint8_t HDC1080_CMD_TEMPERATURE = 0x00;
|
||||
static const uint8_t HDC1080_CMD_HUMIDITY = 0x01;
|
||||
|
||||
void HDC1080Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
const uint8_t data[2] = {
|
||||
0b00000000, // resolution 14bit for both humidity and temperature
|
||||
0b00000000 // reserved
|
||||
|
@ -11,7 +11,6 @@ static const uint32_t HLW8012_CLOCK_FREQUENCY = 3579000;
|
||||
|
||||
void HLW8012Component::setup() {
|
||||
float reference_voltage = 0;
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->sel_pin_->setup();
|
||||
this->sel_pin_->digital_write(this->current_mode_);
|
||||
this->cf_store_.pulse_counter_setup(this->cf_pin_);
|
||||
|
@ -11,7 +11,6 @@ static const uint8_t PM_2_5_VALUE_INDEX = 6;
|
||||
static const uint8_t PM_10_0_VALUE_INDEX = 7;
|
||||
|
||||
void HM3301Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
if (i2c::ERROR_OK != this->write(&SELECT_COMM_CMD, 1)) {
|
||||
error_code_ = ERROR_COMM;
|
||||
this->mark_failed();
|
||||
|
@ -22,7 +22,6 @@ static const uint8_t HMC5883L_REGISTER_IDENTIFICATION_B = 0x0B;
|
||||
static const uint8_t HMC5883L_REGISTER_IDENTIFICATION_C = 0x0C;
|
||||
|
||||
void HMC5883LComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t id[3];
|
||||
if (!this->read_byte(HMC5883L_REGISTER_IDENTIFICATION_A, &id[0]) ||
|
||||
!this->read_byte(HMC5883L_REGISTER_IDENTIFICATION_B, &id[1]) ||
|
||||
|
@ -9,10 +9,7 @@ static const char *const TAG = "honeywellabp";
|
||||
const float MIN_COUNT = 1638.4; // 1638 counts (10% of 2^14 counts or 0x0666)
|
||||
const float MAX_COUNT = 14745.6; // 14745 counts (90% of 2^14 counts or 0x3999)
|
||||
|
||||
void HONEYWELLABPSensor::setup() {
|
||||
ESP_LOGD(TAG, "Setting up Honeywell ABP Sensor ");
|
||||
this->spi_setup();
|
||||
}
|
||||
void HONEYWELLABPSensor::setup() { this->spi_setup(); }
|
||||
|
||||
uint8_t HONEYWELLABPSensor::readsensor_() {
|
||||
// Polls the sensor for new data.
|
||||
|
@ -8,7 +8,6 @@ namespace hte501 {
|
||||
static const char *const TAG = "hte501";
|
||||
|
||||
void HTE501Component::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
uint8_t address[] = {0x70, 0x29};
|
||||
this->write(address, 2, false);
|
||||
uint8_t identification[9];
|
||||
|
@ -18,8 +18,6 @@ static const uint8_t HTU21D_READHEATER_REG_CMD = 0x11; /**< Read Heater Control
|
||||
static const uint8_t HTU21D_REG_HTRE_BIT = 0x02; /**< Control Register Heater Bit */
|
||||
|
||||
void HTU21DComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (!this->write_bytes(HTU21D_REGISTER_RESET, nullptr, 0)) {
|
||||
this->mark_failed();
|
||||
return;
|
||||
|
@ -75,8 +75,6 @@ uint8_t compute_crc(uint32_t value) {
|
||||
* I2C.
|
||||
*/
|
||||
void HTU31DComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
if (!this->reset_()) {
|
||||
this->mark_failed();
|
||||
return;
|
||||
|
@ -8,7 +8,6 @@ namespace hx711 {
|
||||
static const char *const TAG = "hx711";
|
||||
|
||||
void HX711Sensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->name_.c_str());
|
||||
this->sck_pin_->setup();
|
||||
this->dout_pin_->setup();
|
||||
this->sck_pin_->digital_write(false);
|
||||
|
@ -41,7 +41,6 @@ void HydreonRGxxComponent::dump_config() {
|
||||
}
|
||||
|
||||
void HydreonRGxxComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
while (this->available() != 0) {
|
||||
this->read();
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ namespace i2c {
|
||||
static const char *const TAG = "i2c.arduino";
|
||||
|
||||
void ArduinoI2CBus::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
recover_();
|
||||
|
||||
#if defined(USE_ESP32)
|
||||
|
@ -19,7 +19,6 @@ namespace i2c {
|
||||
static const char *const TAG = "i2c.idf";
|
||||
|
||||
void IDFI2CBus::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
static i2c_port_t next_port = I2C_NUM_0;
|
||||
this->port_ = next_port;
|
||||
if (this->port_ == I2C_NUM_MAX) {
|
||||
|
@ -10,8 +10,6 @@ namespace i2s_audio {
|
||||
static const char *const TAG = "i2s_audio";
|
||||
|
||||
void I2SAudioComponent::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
|
||||
static i2s_port_t next_port_num = I2S_NUM_0;
|
||||
if (next_port_num >= SOC_I2S_NUM) {
|
||||
ESP_LOGE(TAG, "Too many components");
|
||||
|
@ -119,10 +119,7 @@ void I2SAudioMediaPlayer::set_volume_(float volume, bool publish) {
|
||||
this->volume = volume;
|
||||
}
|
||||
|
||||
void I2SAudioMediaPlayer::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
this->state = media_player::MEDIA_PLAYER_STATE_IDLE;
|
||||
}
|
||||
void I2SAudioMediaPlayer::setup() { this->state = media_player::MEDIA_PLAYER_STATE_IDLE; }
|
||||
|
||||
void I2SAudioMediaPlayer::loop() {
|
||||
switch (this->i2s_state_) {
|
||||
|
@ -40,7 +40,6 @@ enum MicrophoneEventGroupBits : uint32_t {
|
||||
};
|
||||
|
||||
void I2SAudioMicrophone::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Running setup");
|
||||
#ifdef USE_I2S_LEGACY
|
||||
#if SOC_I2S_SUPPORTS_ADC
|
||||
if (this->adc_) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user