SPI fixes for buggy components (#5446)

This commit is contained in:
Clyde Stubbs 2023-09-29 10:36:31 +10:00 committed by GitHub
parent 4335543575
commit 507dc5f496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 6 deletions

View file

@ -270,7 +270,7 @@ esphome/components/sn74hc165/* @jesserockz
esphome/components/socket/* @esphome/core esphome/components/socket/* @esphome/core
esphome/components/sonoff_d1/* @anatoly-savchenkov esphome/components/sonoff_d1/* @anatoly-savchenkov
esphome/components/speaker/* @jesserockz esphome/components/speaker/* @jesserockz
esphome/components/spi/* @esphome/core esphome/components/spi/* @clydebarrow @esphome/core
esphome/components/spi_device/* @clydebarrow esphome/components/spi_device/* @clydebarrow
esphome/components/spi_led_strip/* @clydebarrow esphome/components/spi_led_strip/* @clydebarrow
esphome/components/sprinkler/* @kbx81 esphome/components/sprinkler/* @kbx81

View file

@ -217,10 +217,7 @@ uint8_t MAX7219Component::printf(const char *format, ...) {
return 0; return 0;
} }
void MAX7219Component::set_writer(max7219_writer_t &&writer) { this->writer_ = writer; } void MAX7219Component::set_writer(max7219_writer_t &&writer) { this->writer_ = writer; }
void MAX7219Component::set_intensity(uint8_t intensity) { void MAX7219Component::set_intensity(uint8_t intensity) { this->intensity_ = intensity; }
this->intensity_ = intensity;
this->send_to_all_(MAX7219_REGISTER_INTENSITY, this->intensity_);
}
void MAX7219Component::set_num_chips(uint8_t num_chips) { this->num_chips_ = num_chips; } void MAX7219Component::set_num_chips(uint8_t num_chips) { this->num_chips_ = num_chips; }
uint8_t MAX7219Component::strftime(uint8_t pos, const char *format, ESPTime time) { uint8_t MAX7219Component::strftime(uint8_t pos, const char *format, ESPTime time) {

View file

@ -28,7 +28,7 @@ from esphome.const import (
) )
from esphome.core import coroutine_with_priority, CORE from esphome.core import coroutine_with_priority, CORE
CODEOWNERS = ["@esphome/core"] CODEOWNERS = ["@esphome/core", "@clydebarrow"]
spi_ns = cg.esphome_ns.namespace("spi") spi_ns = cg.esphome_ns.namespace("spi")
SPIComponent = spi_ns.class_("SPIComponent", cg.Component) SPIComponent = spi_ns.class_("SPIComponent", cg.Component)
SPIDevice = spi_ns.class_("SPIDevice") SPIDevice = spi_ns.class_("SPIDevice")

View file

@ -248,6 +248,7 @@ class SPIDelegateDummy : public SPIDelegate {
SPIDelegateDummy() = default; SPIDelegateDummy() = default;
uint8_t transfer(uint8_t data) override { return 0; } uint8_t transfer(uint8_t data) override { return 0; }
void end_transaction() override{};
void begin_transaction() override; void begin_transaction() override;
}; };