mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-13 01:55:59 +00:00
Fixed arduino i2c fill implementation
This commit is contained in:
parent
027484ef5e
commit
56de6ac3e2
@ -51,14 +51,12 @@ namespace sta
|
|||||||
void ArduinoI2C::fill(uint8_t value, size_t count)
|
void ArduinoI2C::fill(uint8_t value, size_t count)
|
||||||
{
|
{
|
||||||
// Initialize a buffer of size count and fill it with the value.
|
// 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);
|
memset(buffer, value, count);
|
||||||
|
|
||||||
Wire.beginTransmission((uint8_t)address_);
|
Wire.beginTransmission((uint8_t)address_);
|
||||||
Wire.write(buffer, count);
|
Wire.write(buffer, count);
|
||||||
Wire.endTransmission();
|
Wire.endTransmission();
|
||||||
|
|
||||||
delete[] buffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArduinoI2CDevice::ArduinoI2CDevice(I2C * intf, uint8_t address, bool master /* = true */, bool blocking /* = true */)
|
ArduinoI2CDevice::ArduinoI2CDevice(I2C * intf, uint8_t address, bool master /* = true */, bool blocking /* = true */)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user