Skip to content

Commit

Permalink
spi_read_write_io(): Fix buffer size test (#127)
Browse files Browse the repository at this point in the history
bytes_to_write was tested twice by mistake.
  • Loading branch information
andersm authored and agatti committed Mar 9, 2019
1 parent 57f1767 commit b580ca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Firmware/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ void spi_read_write_io(const bool engage_cs) {

#ifndef BP_SPI_ENABLE_STREAMING_READ
/* Make sure data fits in the internal buffer. */
if (bytes_to_write > BP_TERMINAL_BUFFER_SIZE) {
if (bytes_to_read > BP_TERMINAL_BUFFER_SIZE) {
REPORT_IO_FAILURE();
return;
}
Expand Down

0 comments on commit b580ca9

Please sign in to comment.