fix(mipi_dsi): error logic in reading short packet

This commit is contained in:
morris 2024-10-25 11:03:34 +08:00
parent d25f9b6071
commit ceef7a5f91

View File

@ -206,10 +206,10 @@ void mipi_dsi_hal_host_gen_read_short_packet(mipi_dsi_hal_context_t *hal, uint8_
while (!mipi_dsi_host_ll_gen_is_read_fifo_empty(hal->host)) {
temp = mipi_dsi_host_ll_gen_read_payload_fifo(hal->host);
for (int i = 0; i < 4; i++) {
if ((counter + i) < buffer_size) {
receive_buffer[counter + i] = (temp >> (8 * i)) & 0xFF;
if (counter < buffer_size) {
receive_buffer[counter] = (temp >> (8 * i)) & 0xFF;
counter++;
}
counter++;
}
}
}