From dd31122ed30d7bdab2c79db106e876f569247b26 Mon Sep 17 00:00:00 2001 From: Ollo Date: Wed, 9 Dec 2020 21:43:07 +0100 Subject: [PATCH] All static code analyis comments fixed, only TODOs are open --- esp32/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index f7bfe09..e3eb9e3 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -115,13 +115,13 @@ long getLastMoisture(int plantId) } } -long getDistance(){ - unsigned int distance; - byte startByte, h_data, l_data, sum = 0; +long getDistance() { + byte startByte, h_data, l_data, sum; byte buf[3]; startByte = (byte)Serial.read(); - if(startByte == 255){ + if(startByte == 255) { + unsigned int distance; Serial.readBytes(buf, 3); h_data = buf[0]; l_data = buf[1];