1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-27 21:16:50 +03:00

add method to get the actual size of the flash

This commit is contained in:
ficeto 2015-05-18 22:34:34 +03:00
parent 18349b2090
commit ba65783177
2 changed files with 8 additions and 0 deletions

View File

@ -158,6 +158,11 @@ uint32_t EspClass::getFlashChipId(void)
return spi_flash_get_id();
}
uint32_t EspClass::getFlashChipRealSize(void)
{
return (1 << ((spi_flash_get_id() >> 16) & 0xFF));
}
uint32_t EspClass::getFlashChipSize(void)
{
uint32_t data;

View File

@ -90,6 +90,9 @@ class EspClass {
uint8_t getCpuFreqMHz(void);
uint32_t getFlashChipId(void);
//gets the actual chip size based on the flash id
uint32_t getFlashChipRealSize(void);
//gets the size of the flash as set by the compiler
uint32_t getFlashChipSize(void);
uint32_t getFlashChipSpeed(void);
FlashMode_t getFlashChipMode(void);