HuskyLens / HUSKYLENSArduino

74 stars 49 forks source link

Unknown problem around line 706. #12

Open Robert-Proaps opened 2 years ago

Robert-Proaps commented 2 years ago

When trying to compile an arduino sketch the following error is displayed. In file included from C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS\examples\HUSKYLENS_I2C\HUSKYLENS_I2C.ino:22:0: C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h: In member function 'bool HUSKYLENS::writeFirmwareVersion(String)': C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:706:43: error: variable-sized object 'data' may not be initialized uint8_t data[length + 2] = {length}; ^ exit status 1 Error compiling for board Arduino Due (Programming Port). The problematic section appears to be at line 706 which is around here bool writeFirmwareVersion(String version) { Protocol_t protocol; uint8_t length = version.length(); uint8_t data[length + 2] = {length}; version.toCharArray((char *)data + 1, length + 1); protocol.firmwareVersion.length = length + 1; protocol.firmwareVersion.data = data; protocolWriteRequestFirmwareVersion(protocol); return wait(COMMAND_RETURN_OK); }