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:
parent
18349b2090
commit
ba65783177
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user