mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Fixed rc_switch dump off by one bit (#652)
* Fixed rc_switch dump off by one bit * Proper fix per review comments
This commit is contained in:
parent
5cd7f23065
commit
0dfab4d93c
1 changed files with 1 additions and 2 deletions
|
@ -113,7 +113,7 @@ bool RCSwitchBase::decode(RemoteReceiveData &src, uint32_t *out_data, uint8_t *o
|
|||
this->expect_sync(src);
|
||||
|
||||
*out_data = 0;
|
||||
for (*out_nbits = 1; *out_nbits < 32; *out_nbits += 1) {
|
||||
for (*out_nbits = 0; *out_nbits < 32; *out_nbits += 1) {
|
||||
if (this->expect_zero(src)) {
|
||||
*out_data <<= 1;
|
||||
*out_data |= 0;
|
||||
|
@ -121,7 +121,6 @@ bool RCSwitchBase::decode(RemoteReceiveData &src, uint32_t *out_data, uint8_t *o
|
|||
*out_data <<= 1;
|
||||
*out_data |= 1;
|
||||
} else {
|
||||
*out_nbits -= 1;
|
||||
return *out_nbits >= 8;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue