From e5332115e31196679d57cbb0bf0d4c61e543daa9 Mon Sep 17 00:00:00 2001 From: Sunken <29261505+Robert-Proaps@users.noreply.github.com> Date: Tue, 1 Mar 2022 17:44:47 -0500 Subject: [PATCH] Alter code around line 706 to fix compilation errors. I changed the code at line 706 from uint8_t length = version.length(); uint8_t data[length + 2] = {length}; to uint8_t length = version.length(); uint8_t data[length +2]; data[0]=length; This change fixes the following error "libraries\HUSKYLENS/HUSKYLENS.h:706:43: error: variable-sized object 'data' may not be initialized uint8_t data[length + 2] = {length}; ^" This error would prevent any code that includes the HUSKYLENS.h library from compiling. --- HUSKYLENS/HUSKYLENS.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HUSKYLENS/HUSKYLENS.h b/HUSKYLENS/HUSKYLENS.h index d2e0ba6..0fad95d 100644 --- a/HUSKYLENS/HUSKYLENS.h +++ b/HUSKYLENS/HUSKYLENS.h @@ -703,7 +703,8 @@ class HUSKYLENS { Protocol_t protocol; uint8_t length = version.length(); - uint8_t data[length + 2] = {length}; + uint8_t data[length + 2]; + data[0]=length; version.toCharArray((char *)data + 1, length + 1); protocol.firmwareVersion.length = length + 1; protocol.firmwareVersion.data = data;