From fe392acfbd632abc34df18cec3d3a22397866f13 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Sat, 26 Dec 2020 17:39:10 +0100 Subject: [PATCH] Change type for consistency (Now it's inconsistent with the char* in readBytes, but at least it's consistent in this file...) Thanks, supakeen! Also changed the type for the returned value. --- operame.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operame.ino b/operame.ino index 92be484..0bd9464 100644 --- a/operame.ino +++ b/operame.ino @@ -319,7 +319,7 @@ int aqc_get_co2() { static bool initialized = false; const uint8_t command[9] = { 0xff, 0x01, 0xc5, 0, 0, 0, 0, 0, 0x3a }; - char response[9]; + uint8_t response[9]; int co2 = -1; for (int attempt = 0; attempt < 3; attempt++) { @@ -329,7 +329,7 @@ int aqc_get_co2() { hwserial1.write(command, sizeof(command)); delay(50); - int c = hwserial1.readBytes(response, sizeof(response)); + size_t c = hwserial1.readBytes(response, sizeof(response)); if (c != sizeof(response) || response[0] != 0xff || response[1] != 0x86) { continue; }