mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
Merge remote-tracking branch 'origin/dev' into integration
This commit is contained in:
@@ -87,19 +87,12 @@ void GreeClimate::transmit_state() {
|
||||
// Calculate the checksum
|
||||
if (this->model_ == GREE_YAN || this->model_ == GREE_YX1FF) {
|
||||
remote_state[7] = ((remote_state[0] << 4) + (remote_state[1] << 4) + 0xC0);
|
||||
} else if (this->model_ == GREE_YAG) {
|
||||
} else {
|
||||
remote_state[7] =
|
||||
((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
|
||||
((remote_state[4] & 0xF0) >> 4) + ((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + 0x0A) &
|
||||
0x0F)
|
||||
<< 4);
|
||||
} else {
|
||||
remote_state[7] =
|
||||
((((remote_state[0] & 0x0F) + (remote_state[1] & 0x0F) + (remote_state[2] & 0x0F) + (remote_state[3] & 0x0F) +
|
||||
((remote_state[5] & 0xF0) >> 4) + ((remote_state[6] & 0xF0) >> 4) + ((remote_state[7] & 0xF0) >> 4) + 0x0A) &
|
||||
0x0F)
|
||||
<< 4) |
|
||||
(remote_state[7] & 0x0F);
|
||||
}
|
||||
|
||||
auto transmit = this->transmitter_->transmit();
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace esphome {
|
||||
// SIZING: When paired with a LockFreeQueue<T, Q_SIZE>, the pool SIZE should be
|
||||
// Q_SIZE - 1 (the queue's actual capacity, since the ring buffer reserves one slot).
|
||||
// This ensures allocate() returns nullptr before push() can fail, which:
|
||||
// - Prevents permanently leaking a pool slot
|
||||
// - Prevents the allocate-succeeds-but-push-fails mismatch that permanently
|
||||
// leaks a pool slot (the element is never returned to the pool)
|
||||
// - Avoids needing release() on the producer path after a failed push(),
|
||||
// preserving the SPSC contract on the internal free list
|
||||
template<class T, uint8_t SIZE> class EventPool {
|
||||
|
||||
Reference in New Issue
Block a user