1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #12538 from gschorcht/cpu/esp32/fix_cs_handling

cpu/esp32: fix CS handling in spi_transfer_bytes
This commit is contained in:
Marian Buschsieweke 2019-10-22 15:35:48 +02:00 committed by GitHub
commit cd5cda21d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,7 +456,9 @@ void IRAM_ATTR spi_transfer_bytes(spi_t bus, spi_cs_t cs, bool cont,
}
#endif
gpio_clear (cs != SPI_CS_UNDEF ? cs : spi_config[bus].cs);
if (cs != SPI_CS_UNDEF) {
gpio_clear(cs);
}
size_t blocks = len / SPI_BLOCK_SIZE;
uint8_t tail = len % SPI_BLOCK_SIZE;
@ -474,8 +476,9 @@ void IRAM_ATTR spi_transfer_bytes(spi_t bus, spi_cs_t cs, bool cont,
out ? (const uint8_t *)out + blocks * SPI_BLOCK_SIZE : 0,
in ? (uint8_t *)in + blocks * SPI_BLOCK_SIZE : NULL, tail);
}
if (!cont) {
gpio_set (cs != SPI_CS_UNDEF ? cs : spi_config[bus].cs);
if (!cont && (cs != SPI_CS_UNDEF)) {
gpio_set (cs);
}
#if ENABLE_DEBUG