Static word-aligned buffer for SPI

This commit is contained in:
Manuel Bl 2021-01-05 21:26:36 +01:00
parent f57c505d7e
commit 3086b1bb58
1 changed files with 4 additions and 3 deletions

View File

@ -382,10 +382,11 @@ static void writeReg (u1_t addr, u1_t data ) {
hal_spi_write(addr | 0x80, &data, 1);
}
static u1_t reg_value_buf[1];
static u1_t readReg (u1_t addr) {
u1_t buf[1];
hal_spi_read(addr & 0x7f, buf, 1);
return buf[0];
hal_spi_read(addr & 0x7f, reg_value_buf, 1);
return reg_value_buf[0];
}
static void writeBuf (u1_t addr, xref2u1_t buf, u1_t len) {