Skip to content

Commit 2aeb0f0

Browse files
author
Richard Unger
committed
fix ESP32 compiler problem
1 parent 87b8d9e commit 2aeb0f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/encoders/as5047u/AS5047U.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ uint8_t AS5047U::calcCRC(uint16_t data){
317317
}
318318

319319
uint16_t AS5047U::writeRegister24(uint16_t reg, uint16_t data) {
320-
uint8_t buff[3] = { (reg>>8)&0x3F, reg&0xFF, calcCRC(reg) };
320+
uint8_t buff[3];
321+
buff[0] = (reg>>8)&0x3F;
322+
buff[1] = reg&0xFF;
323+
buff[2] = calcCRC(reg);
321324
if (nCS>=0)
322325
digitalWrite(nCS, 0);
323326
spi->beginTransaction(settings);

0 commit comments

Comments
 (0)