Skip to content

Commit 199d8b7

Browse files
committed
fix: fix spi address16 bugs
1 parent d3d3fbd commit 199d8b7

File tree

1 file changed

+1
-1
lines changed
  • project/raspberrypi4b/interface/src

1 file changed

+1
-1
lines changed

project/raspberrypi4b/interface/src/spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ uint8_t spi_write_address16(int fd, uint16_t reg, uint8_t *buf, uint16_t len)
383383
/* set the command */
384384
command[0] = (reg >> 8) & 0xFF;
385385
command[1] = reg & 0xFF;
386-
memset(&command[2], 0x00, len);
386+
memcpy(&command[2], buf, len);
387387

388388
/* clear ioc transfer */
389389
memset(&k, 0, sizeof(struct spi_ioc_transfer));

0 commit comments

Comments
 (0)