mc33810: some comments about polling loop

This commit is contained in:
Andrey Gusakov 2024-07-22 23:43:16 +03:00 committed by rusefillc
parent 0645581ebd
commit 0084f35830
1 changed files with 4 additions and 0 deletions

View File

@ -197,6 +197,10 @@ int Mc33810::spi_unselect()
SPIDriver *spi = cfg->spi_bus;
if (cfg->sck.port) {
/* Lets poll for SCK=0... spiPolledExchange() returns while SPI HW is
* still active and did not set SCK low yet. So do ot drive CS high until
* SCK is low. This polling should not take much time. But anyway we have
* timeout exit. */
while (palReadPad(cfg->sck.port, cfg->sck.pad) && (++retry < 1000)) {
/* NOP */
}