summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHierophect <hierophect@gmail.com>2019-10-03 14:43:25 -0400
committerHierophect <hierophect@gmail.com>2019-10-03 14:43:25 -0400
commiteacdb1da6e91f9f02b552e51e3809001408cfc95 (patch)
treead28281c5c8f23e3171ae24a5cb1a79827dac96e
parent83c49a5c8016790872d904689735cdbb66f7ab4c (diff)
Disable timeout, remove redundancy
-rw-r--r--ports/stm32f4/common-hal/busio/SPI.c12
-rw-r--r--supervisor/shared/external_flash/devices.h18
2 files changed, 6 insertions, 24 deletions
diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c
index 70d4adec4..e20bd7a94 100644
--- a/ports/stm32f4/common-hal/busio/SPI.c
+++ b/ports/stm32f4/common-hal/busio/SPI.c
@@ -383,21 +383,21 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) {
bool common_hal_busio_spi_write(busio_spi_obj_t *self,
const uint8_t *data, size_t len) {
- HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, 500);
- return result == HAL_OK ? 1 : 0;
+ HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY);
+ return result == HAL_OK;
}
bool common_hal_busio_spi_read(busio_spi_obj_t *self,
uint8_t *data, size_t len, uint8_t write_value) {
- HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, 500);
- return result == HAL_OK ? 1 : 0;
+ HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY);
+ return result == HAL_OK;
}
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
uint8_t *data_out, uint8_t *data_in, size_t len) {
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
- data_out, data_in, (uint16_t)len,500);
- return result == HAL_OK ? 1 : 0;
+ data_out, data_in, (uint16_t)len,HAL_MAX_DELAY);
+ return result == HAL_OK;
}
uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) {
diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h
index 4e037574b..4de22719a 100644
--- a/supervisor/shared/external_flash/devices.h
+++ b/supervisor/shared/external_flash/devices.h
@@ -443,22 +443,4 @@ typedef struct {
.single_status_byte = false, \
}
-// Settings for the Micron N25Q128A 16MiB SPI flash.
-// Datasheet: https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_128mb_3v_65nm.pdf
-#define N25Q128A {\
- .total_size = (1 << 24), /* 16 MiB */ \
- .start_up_time_us = 5000, \
- .manufacturer_id = 0x20, \
- .memory_type = 0xBA, \
- .capacity = 0x18, \
- .max_clock_speed_mhz = 108, \
- .quad_enable_bit_mask = 0x00, \
- .has_sector_protection = false, \
- .supports_fast_read = true, \
- .supports_qspi = true, \
- .supports_qspi_writes = true, \
- .write_status_register_split = false, \
- .single_status_byte = false, \
-}
-
#endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H