File tree 2 files changed +8
-0
lines changed
hardware/esp8266com/esp8266/cores/esp8266
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ uint32_t EspClass::getFlashChipId(void)
158
158
return spi_flash_get_id ();
159
159
}
160
160
161
+ uint32_t EspClass::getFlashChipRealSize (void )
162
+ {
163
+ return (1 << ((spi_flash_get_id () >> 16 ) & 0xFF ));
164
+ }
165
+
161
166
uint32_t EspClass::getFlashChipSize (void )
162
167
{
163
168
uint32_t data;
Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ class EspClass {
90
90
uint8_t getCpuFreqMHz (void );
91
91
92
92
uint32_t getFlashChipId (void );
93
+ // gets the actual chip size based on the flash id
94
+ uint32_t getFlashChipRealSize (void );
95
+ // gets the size of the flash as set by the compiler
93
96
uint32_t getFlashChipSize (void );
94
97
uint32_t getFlashChipSpeed (void );
95
98
FlashMode_t getFlashChipMode (void );
You can’t perform that action at this time.
0 commit comments