Use uint8_t instead of uint32_t for 8-bit values on mitsubishi (#6824)

This solves some printf formatting issues on ESP-IDF and saves RAM on all platforms.
This commit is contained in:
DAVe3283 2024-05-28 14:44:47 -06:00 committed by GitHub
parent db6f6f0cb7
commit 06996def72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ namespace mitsubishi {
static const char *const TAG = "mitsubishi.climate";
const uint32_t MITSUBISHI_OFF = 0x00;
const uint8_t MITSUBISHI_OFF = 0x00;
const uint8_t MITSUBISHI_MODE_AUTO = 0x20;
const uint8_t MITSUBISHI_MODE_COOL = 0x18;
@ -109,8 +109,8 @@ void MitsubishiClimate::transmit_state() {
// Byte 15: HVAC specfic, i.e. POWERFUL, SMART SET, PLASMA, always 0x00
// Byte 16: Constant 0x00
// Byte 17: Checksum: SUM[Byte0...Byte16]
uint32_t remote_state[18] = {0x23, 0xCB, 0x26, 0x01, 0x00, 0x20, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t remote_state[18] = {0x23, 0xCB, 0x26, 0x01, 0x00, 0x20, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
switch (this->mode) {
case climate::CLIMATE_MODE_HEAT:
@ -249,7 +249,7 @@ void MitsubishiClimate::transmit_state() {
data->set_carrier_frequency(38000);
// repeat twice
for (uint16_t r = 0; r < 2; r++) {
for (uint8_t r = 0; r < 2; r++) {
// Header
data->mark(MITSUBISHI_HEADER_MARK);
data->space(MITSUBISHI_HEADER_SPACE);