Increase SPI timeout duration
This commit is contained in:
parent
8a4bbae077
commit
83c49a5c80
@ -383,20 +383,20 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) {
|
|||||||
|
|
||||||
bool common_hal_busio_spi_write(busio_spi_obj_t *self,
|
bool common_hal_busio_spi_write(busio_spi_obj_t *self,
|
||||||
const uint8_t *data, size_t len) {
|
const uint8_t *data, size_t len) {
|
||||||
HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, 5);
|
HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, 500);
|
||||||
return result == HAL_OK ? 1 : 0;
|
return result == HAL_OK ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool common_hal_busio_spi_read(busio_spi_obj_t *self,
|
bool common_hal_busio_spi_read(busio_spi_obj_t *self,
|
||||||
uint8_t *data, size_t len, uint8_t write_value) {
|
uint8_t *data, size_t len, uint8_t write_value) {
|
||||||
HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, 5);
|
HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, 500);
|
||||||
return result == HAL_OK ? 1 : 0;
|
return result == HAL_OK ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
|
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
|
||||||
uint8_t *data_out, uint8_t *data_in, size_t len) {
|
uint8_t *data_out, uint8_t *data_in, size_t len) {
|
||||||
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
|
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
|
||||||
data_out, data_in, (uint16_t)len,5);
|
data_out, data_in, (uint16_t)len,500);
|
||||||
return result == HAL_OK ? 1 : 0;
|
return result == HAL_OK ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user