Skip to content

Commit 6abcac4

Browse files
committed
not needed on rp2040
1 parent 2b64318 commit 6abcac4

File tree

1 file changed

+2
-2
lines changed
  • ports/raspberrypi/common-hal/busio

1 file changed

+2
-2
lines changed

ports/raspberrypi/common-hal/busio/SPI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self,
263263

264264
bool common_hal_busio_spi_read(busio_spi_obj_t *self,
265265
uint8_t *data, size_t len, uint8_t write_value) {
266-
memset(data, write_value, len);
267-
return _transfer(self, data, len, data, len);
266+
uint32_t data_out = write_value << 24 | write_value << 16 | write_value << 8 | write_value;
267+
return _transfer(self, (const uint8_t *)&data_out, MIN(4, len), data, len);
268268
}
269269

270270
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) {

0 commit comments

Comments
 (0)