1
0
mirror of https://github.com/revspace/operame synced 2024-10-31 21:47:30 +00:00

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.
This commit is contained in:
Juerd Waalboer 2020-12-26 17:39:10 +01:00
parent 14f917b84f
commit fe392acfbd

View File

@ -319,7 +319,7 @@ int aqc_get_co2() {
static bool initialized = false; static bool initialized = false;
const uint8_t command[9] = { 0xff, 0x01, 0xc5, 0, 0, 0, 0, 0, 0x3a }; const uint8_t command[9] = { 0xff, 0x01, 0xc5, 0, 0, 0, 0, 0, 0x3a };
char response[9]; uint8_t response[9];
int co2 = -1; int co2 = -1;
for (int attempt = 0; attempt < 3; attempt++) { for (int attempt = 0; attempt < 3; attempt++) {
@ -329,7 +329,7 @@ int aqc_get_co2() {
hwserial1.write(command, sizeof(command)); hwserial1.write(command, sizeof(command));
delay(50); 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) { if (c != sizeof(response) || response[0] != 0xff || response[1] != 0x86) {
continue; continue;
} }