|
@@ -57,9 +57,11 @@ uint32_t flash_get_size_byte(void)
|
|
|
case SIZE_32MBIT:
|
|
|
// 32Mbit, 4MByte
|
|
|
flash_size = 4 * 1024 * 1024;
|
|
|
+ break;
|
|
|
case SIZE_64MBIT:
|
|
|
// 64Mbit, 8MByte
|
|
|
flash_size = 8 * 1024 * 1024;
|
|
|
+ break;
|
|
|
case SIZE_128MBIT:
|
|
|
// 128Mbit, 16MByte
|
|
|
flash_size = 16 * 1024 * 1024;
|
|
@@ -132,7 +134,15 @@ bool flash_set_size_byte(uint32_t size)
|
|
|
|
|
|
uint16_t flash_get_sec_num(void)
|
|
|
{
|
|
|
- return flash_get_size_byte() / SPI_FLASH_SEC_SIZE;
|
|
|
+ //static uint16_t sec_num = 0;
|
|
|
+ // return flash_get_size_byte() / (SPI_FLASH_SEC_SIZE);
|
|
|
+ // c_printf("\nflash_get_size_byte()=%d\n", ( flash_get_size_byte() / (SPI_FLASH_SEC_SIZE) ));
|
|
|
+ // if( sec_num == 0 )
|
|
|
+ //{
|
|
|
+ // sec_num = 4 * 1024 * 1024 / (SPI_FLASH_SEC_SIZE);
|
|
|
+ //}
|
|
|
+ //return sec_num;
|
|
|
+ return ( flash_get_size_byte() / (SPI_FLASH_SEC_SIZE) );
|
|
|
}
|
|
|
|
|
|
uint8_t flash_get_mode(void)
|