Skip to content

Commit

Permalink
Bugfix: flashmem_get_info() only works if running from slot #0. (#1923
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mikee47 authored and slaff committed Oct 30, 2019
1 parent 0e648c1 commit d935042
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sming/Arch/Esp8266/Components/spi_flash/flashmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ bool flashmem_erase_sector(uint32_t sector_id)

SPIFlashInfo flashmem_get_info()
{
volatile SPIFlashInfo spi_flash_info STORE_ATTR;
spi_flash_info = *((SPIFlashInfo *)(INTERNAL_FLASH_START_ADDRESS));
SPIFlashInfo spi_flash_info STORE_ATTR;
if(flashmem_read_internal(&spi_flash_info, 0x00000000, sizeof(spi_flash_info)) == 0) {
memset(&spi_flash_info, 0, sizeof(spi_flash_info));
}
return spi_flash_info;
}

Expand Down

0 comments on commit d935042

Please sign in to comment.