1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Delete dubious SPI timeout mechanism

The result from this mechanism is never checked, and SPI is not a bus
prone to timeouts anyway (the master generates the clock and the
transmission happens in a deterministic amount of time no matter if the
slave is cooperative, absent, or uncooperative.)

The timeout counter was set *per transfer*, and is fixed no matter what
the SPI clock speed. If the transfer size is large, and the SPI clock is
slow, stalls on the SPI bus are unavoidable (as we can generate data
faster than SPI can transmit it). These accumulate over the length of a
long transfer and trigger a "timeout". Detecting these as fatal timeouts
is not helpful.
This commit is contained in:
Nicholas Sherlock 2015-11-18 20:04:55 +13:00 committed by borisbstyle
parent 264c094eef
commit 3941c6c252
3 changed files with 26 additions and 207 deletions

View file

@ -26,7 +26,4 @@ void spiSetDivisor(SPI_TypeDef *instance, uint16_t divisor);
uint8_t spiTransferByte(SPI_TypeDef *instance, uint8_t in);
bool spiIsBusBusy(SPI_TypeDef *instance);
bool spiTransfer(SPI_TypeDef *instance, uint8_t *out, const uint8_t *in, int len);
uint16_t spiGetErrorCounter(SPI_TypeDef *instance);
void spiResetErrorCounter(SPI_TypeDef *instance);
void spiTransfer(SPI_TypeDef *instance, uint8_t *out, const uint8_t *in, int len);