diff options
| author | Uri Shaked | 2021-12-13 11:35:26 +0200 |
|---|---|---|
| committer | Uri Shaked | 2021-12-13 11:35:26 +0200 |
| commit | 1d70883bc19cfda0ade132783a71d6e5fbaff79d (patch) | |
| tree | ee122443aea75a1f83f08f4882608122fbbd070e /src/utils/assembler.spec.ts | |
| parent | 0.18.6 (diff) | |
| download | avr8js-1d70883bc19cfda0ade132783a71d6e5fbaff79d.tar.gz avr8js-1d70883bc19cfda0ade132783a71d6e5fbaff79d.tar.bz2 avr8js-1d70883bc19cfda0ade132783a71d6e5fbaff79d.zip | |
fix(twi): fails on repeated start condition
reproduction: https://wokwi.com/arduino/projects/306115576172905024
minimal reproduction code:
```cpp
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin();
Wire.beginTransmission(0x68);
Wire.write( 0x3B);
Wire.endTransmission( false); // <---- Fails after this
auto n = Wire.requestFrom(0x68, 6);
if (n == 6) {
int16_t AcX = Wire.read() << 8 | Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
int16_t AcY = Wire.read() << 8 | Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
int16_t AcZ = Wire.read() << 8 | Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
Serial.print( "AcX = "); Serial.print( AcX);
Serial.print( " | AcY = "); Serial.print( AcY);
Serial.print( " | AcZ = "); Serial.print( AcZ);
Serial.println();
} else {
Serial.println( "--------- ERROR ---------");
}
}
void loop() {}
```
Diffstat (limited to 'src/utils/assembler.spec.ts')
0 files changed, 0 insertions, 0 deletions
