Skip to content

Commit eacdb1d

Browse files
committed
Disable timeout, remove redundancy
1 parent 83c49a5 commit eacdb1d

2 files changed

Lines changed: 6 additions & 24 deletions

File tree

  • ports/stm32f4/common-hal/busio
  • supervisor/shared/external_flash

ports/stm32f4/common-hal/busio/SPI.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,21 +383,21 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) {
383383

384384
bool common_hal_busio_spi_write(busio_spi_obj_t *self,
385385
const uint8_t *data, size_t len) {
386-
HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, 500);
387-
return result == HAL_OK ? 1 : 0;
386+
HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY);
387+
return result == HAL_OK;
388388
}
389389

390390
bool common_hal_busio_spi_read(busio_spi_obj_t *self,
391391
uint8_t *data, size_t len, uint8_t write_value) {
392-
HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, 500);
393-
return result == HAL_OK ? 1 : 0;
392+
HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY);
393+
return result == HAL_OK;
394394
}
395395

396396
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
397397
uint8_t *data_out, uint8_t *data_in, size_t len) {
398398
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
399-
data_out, data_in, (uint16_t)len,500);
400-
return result == HAL_OK ? 1 : 0;
399+
data_out, data_in, (uint16_t)len,HAL_MAX_DELAY);
400+
return result == HAL_OK;
401401
}
402402

403403
uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) {

supervisor/shared/external_flash/devices.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -443,22 +443,4 @@ typedef struct {
443443
.single_status_byte = false, \
444444
}
445445

446-
// Settings for the Micron N25Q128A 16MiB SPI flash.
447-
// Datasheet: https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_128mb_3v_65nm.pdf
448-
#define N25Q128A {\
449-
.total_size = (1 << 24), /* 16 MiB */ \
450-
.start_up_time_us = 5000, \
451-
.manufacturer_id = 0x20, \
452-
.memory_type = 0xBA, \
453-
.capacity = 0x18, \
454-
.max_clock_speed_mhz = 108, \
455-
.quad_enable_bit_mask = 0x00, \
456-
.has_sector_protection = false, \
457-
.supports_fast_read = true, \
458-
.supports_qspi = true, \
459-
.supports_qspi_writes = true, \
460-
.write_status_register_split = false, \
461-
.single_status_byte = false, \
462-
}
463-
464446
#endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H

0 commit comments

Comments
 (0)