From df4f305e3ae502e37f94ca61750683388c30d2fb Mon Sep 17 00:00:00 2001 From: Staars Date: Thu, 13 Dec 2018 13:46:59 +0100 Subject: [PATCH] correcting memcpy calls --- sonoff/xsns_15_mhz19.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonoff/xsns_15_mhz19.ino b/sonoff/xsns_15_mhz19.ino index 594a47106..523dd3a66 100644 --- a/sonoff/xsns_15_mhz19.ino +++ b/sonoff/xsns_15_mhz19.ino @@ -115,12 +115,12 @@ size_t MhzSendCmd(byte command_id) mhz_send[0] = 0xFF; // Start byte, fixed mhz_send[1] = 0x01; // Sensor number, 0x01 by default - memcpy_P(&mhz_send[2], kMhzCommands[command_id], sizeof(kMhzCommands[2])); + memcpy_P(&mhz_send[2], kMhzCommands[command_id], sizeof(uint16_t)); /* mhz_send[4] = 0x00; mhz_send[5] = 0x00; */ - memcpy_P(&mhz_send[6], kMhzCommands[command_id] + sizeof(kMhzCommands[2]), sizeof(kMhzCommands[2])); + memcpy_P(&mhz_send[6], kMhzCommands[command_id] + sizeof(uint16_t), sizeof(uint16_t)); mhz_send[8] = MhzCalculateChecksum(mhz_send); snprintf_P(log_data, sizeof(log_data), PSTR("Final MhzCommand: %x %x %x %x %x %x %x %x %x"),mhz_send[0],mhz_send[1],mhz_send[2],mhz_send[3],mhz_send[4],mhz_send[5],mhz_send[6],mhz_send[7],mhz_send[8]);