formatting

This commit is contained in:
Gábor Poczkodi 2024-10-11 17:56:12 +02:00
parent 74ca4e04bb
commit f448db79d5
3 changed files with 62 additions and 65 deletions

View file

@ -158,18 +158,13 @@ void KT0803Component::update() {
*/ */
} }
void KT0803Component::loop() { void KT0803Component::loop() {}
}
// config // config
void KT0803Component::set_chip_id(ChipId value) { void KT0803Component::set_chip_id(ChipId value) { this->chip_id_ = value; }
this->chip_id_ = value;
}
ChipId KT0803Component::get_chip_id() { ChipId KT0803Component::get_chip_id() { return this->chip_id_; }
return this->chip_id_;
}
std::string KT0803Component::get_chip_string() const { std::string KT0803Component::get_chip_string() const {
switch (this->chip_id_) { switch (this->chip_id_) {
@ -198,7 +193,9 @@ void KT0803Component::set_frequency(float value) {
this->state_.CHSEL0 = (uint8_t) ((ch >> 0) & 0x01); this->state_.CHSEL0 = (uint8_t) ((ch >> 0) & 0x01);
this->write_reg_(0x00); this->write_reg_(0x00);
this->write_reg_(0x01); this->write_reg_(0x01);
if (this->chip_id_ != ChipId::KT0803) {
this->write_reg_(0x02); this->write_reg_(0x02);
}
this->publish_frequency(); this->publish_frequency();
} }