Fix bad returns, revert flash changes

This commit is contained in:
Hierophect 2019-09-29 13:18:43 -04:00
parent 270396a882
commit 89315999e2
3 changed files with 6 additions and 6 deletions

View File

@ -7,8 +7,8 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 112K /* sectors 1,2,3 are 16K */
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 896K /* sector 4 is 64K, sectors 5,6,7 are 128K */
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
}

View File

@ -284,14 +284,14 @@ 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, 2);
if(!(result==HAL_OK)) mp_raise_RuntimeError(translate("SPI write error"));
return true; //result == HAL_OK ? 0 : 1;
return result == HAL_OK ? 1 : 0;
}
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, 2);
if(!(result==HAL_OK)) mp_raise_RuntimeError(translate("SPI read error"));
return true; //result == HAL_OK ? 0 : 1;
return result == HAL_OK ? 1 : 0;
}
bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
@ -299,7 +299,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
data_out, data_in, (uint16_t)len,2);
if(!(result==HAL_OK)) mp_raise_RuntimeError(translate("SPI transfer error"));
return true; //result == HAL_OK ? 0 : 1;
return result == HAL_OK ? 1 : 0;
}
uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) {

View File

@ -39,7 +39,7 @@
#ifdef STM32F412Zx
#define STM32_FLASH_SIZE 0x100000 //1MB
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //112KiB
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB
#endif
#ifdef STM32F405xx