We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 056b098 commit f14f29aCopy full SHA for f14f29a
src/MagAlpha.cpp
@@ -111,8 +111,7 @@ uint8_t MagAlpha::readRegister(uint8_t address){
111
digitalWrite(_spiChipSelectPin, HIGH);
112
delayMicroseconds(1); //Wait for 1us (=1000 ns) to respect tIdleReg of 750ns before register readout
113
digitalWrite(_spiChipSelectPin, LOW);
114
- uint16_t result = SPI.transfer16(0x0000);
115
- readbackRegisterValue = ((result & 0xFF00) >> 8);
+ readbackRegisterValue = ((SPI.transfer16(0x0000) & 0xFF00) >> 8);
116
117
delayMicroseconds(1); //Wait for 1us (=1000 ns) to respect tIdleReg of 750ns after register readout
118
return readbackRegisterValue;
0 commit comments