fix buffer over-read

This commit is contained in:
Kilian Bracher 2024-10-19 18:56:10 +02:00
parent b042c68965
commit dcb4f48082
Signed by: k.bracher
SSH Key Fingerprint: SHA256:mXpyZkK7RDiJ7qeHCKJX108woM0cl5TrCvNBJASu6lM
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ uint8_t amsWriteComm(uint8_t device, uint8_t addr, uint8_t data) {
CHECK_RETURN(writeCMD(WRCOMM, txbuf, COMM_GROUP_SIZE)); CHECK_RETURN(writeCMD(WRCOMM, txbuf, COMM_GROUP_SIZE));
uint8_t rxbuf[6] = {0,0,0,0,0,0}; uint8_t rxbuf[6] = {0,0,0,0,0,0};
readCMD(RDCOMM, rxbuf, COMM_GROUP_SIZE); readCMD(RDCOMM, rxbuf, COMM_GROUP_SIZE);
if (rxbuf[6] != txbuf[6]) { if (rxbuf[5] != txbuf[5]) { // assert that the data was written correctly
while(1){} while(1){}
} }
CHECK_RETURN(writeCMD_I2C(STCOMM, 72, NULL, 0)); CHECK_RETURN(writeCMD_I2C(STCOMM, 72, NULL, 0));