diff --git a/src/devices/arduino/bus/i2c.cpp b/src/devices/arduino/bus/i2c.cpp index 71e6815..1367782 100644 --- a/src/devices/arduino/bus/i2c.cpp +++ b/src/devices/arduino/bus/i2c.cpp @@ -51,14 +51,12 @@ namespace sta void ArduinoI2C::fill(uint8_t value, size_t count) { // Initialize a buffer of size count and fill it with the value. - uint8_t *buffer = new uint8_t[count]; + uint8_t buffer[count]; memset(buffer, value, count); Wire.beginTransmission((uint8_t)address_); Wire.write(buffer, count); Wire.endTransmission(); - - delete[] buffer; } ArduinoI2CDevice::ArduinoI2CDevice(I2C * intf, uint8_t address, bool master /* = true */, bool blocking /* = true */)