mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
A future proof solution ;-)
This commit is contained in:
parent
b0d5cffe16
commit
09f473b734
@ -659,8 +659,9 @@ uint32_t ESP_getFlashChipMagicSize(void) {
|
|||||||
return ESP_magicFlashChipSize(fhdr.spi_size);
|
return ESP_magicFlashChipSize(fhdr.spi_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ESP_magicFlashChipSize(uint8_t byte) {
|
uint32_t ESP_magicFlashChipSize(uint8_t spi_size) {
|
||||||
switch(byte & 0x0F) {
|
/*
|
||||||
|
switch(spi_size & 0x0F) {
|
||||||
case 0x0: // 8 MBit (1MB)
|
case 0x0: // 8 MBit (1MB)
|
||||||
return 1048576;
|
return 1048576;
|
||||||
case 0x1: // 16 MBit (2MB)
|
case 0x1: // 16 MBit (2MB)
|
||||||
@ -676,6 +677,8 @@ uint32_t ESP_magicFlashChipSize(uint8_t byte) {
|
|||||||
default: // fail so return (1KB)
|
default: // fail so return (1KB)
|
||||||
return 1024;
|
return 1024;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
return (uint32_t)0x100000 << spi_size; // 0 = 8 MBit (1MB), 5 = 256 MBit (32MB)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ESP_getSketchSize(void) {
|
uint32_t ESP_getSketchSize(void) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user