We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8b1fb7 commit c7ec577Copy full SHA for c7ec577
1 file changed
src/drivers/drv8899.c
@@ -41,6 +41,10 @@ drv8899_read_reg(drv8899_t *d, uint8_t reg)
41
error_t err = d->spi->rw(d->spi, d->tx, d->rx, 2, d->cs, d->spi_config);
42
if(err)
43
return err;
44
+ // SDO status byte: [1][1][UVLO][CPUV][OCP][0][TF][OL]
45
+ // Validate fixed bits: top two must be 1, bit 2 (RSVD) must be 0
46
+ if((d->rx[0] & 0xc4) != 0xc0)
47
+ return ERR_MALFORMED;
48
return d->rx[1];
49
}
50
0 commit comments