mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 18:18:43 +00:00
[pca9554] Use a user provided default constructor for PCA9554GPIOPin (#19208)
This commit is contained in:
@@ -55,6 +55,9 @@ class PCA9554Component final : public Component,
|
||||
/// Helper class to expose a PCA9554 pin as an internal input GPIO pin.
|
||||
class PCA9554GPIOPin final : public GPIOPin {
|
||||
public:
|
||||
// User provided, not "= default": `new(p) PCA9554GPIOPin()` would zero-fill .bss that is already zero.
|
||||
PCA9554GPIOPin() {}
|
||||
|
||||
void setup() override;
|
||||
void pin_mode(gpio::Flags flags) override;
|
||||
bool digital_read() override;
|
||||
@@ -69,10 +72,10 @@ class PCA9554GPIOPin final : public GPIOPin {
|
||||
gpio::Flags get_flags() const override { return this->flags_; }
|
||||
|
||||
protected:
|
||||
PCA9554Component *parent_;
|
||||
uint8_t pin_;
|
||||
bool inverted_;
|
||||
gpio::Flags flags_;
|
||||
PCA9554Component *parent_{nullptr};
|
||||
uint8_t pin_{0};
|
||||
bool inverted_{false};
|
||||
gpio::Flags flags_{};
|
||||
};
|
||||
|
||||
} // namespace esphome::pca9554
|
||||
|
||||
Reference in New Issue
Block a user