summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modesp.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-05-12 15:58:19 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-05-12 16:00:05 +0300
commit3e05df7fd1038d1e733559a7c180ac7da20b2aa6 (patch)
tree533f278b3932212f321350c0a7653e12bda09077 /esp8266/modesp.c
parent0987ad5e30239c642fb6f16508bac6b6b9a4a46b (diff)
downloadmicropython-3e05df7fd1038d1e733559a7c180ac7da20b2aa6.tar.gz
micropython-3e05df7fd1038d1e733559a7c180ac7da20b2aa6.zip
esp8266/modesp: flash_user_start: Use value from linker script.
Make esp8266_common.ld export size reserved to all code segments, and use that in esp.flash_user_start() implementation.
Diffstat (limited to 'esp8266/modesp.c')
-rw-r--r--esp8266/modesp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index 432fd5ac31..5eaae27d6a 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -159,12 +159,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_size_obj, esp_flash_size);
// we assume there's a yaota8266 bootloader.
#define IS_OTA_FIRMWARE() ((*(uint32_t*)0x40200000 & 0xff00) == 0x100)
+extern byte _firmware_size[];
+
STATIC mp_obj_t esp_flash_user_start(void) {
- if (IS_OTA_FIRMWARE()) {
- return MP_OBJ_NEW_SMALL_INT(0x3c000 + 0x90000);
- } else {
- return MP_OBJ_NEW_SMALL_INT(0x90000);
- }
+ return MP_OBJ_NEW_SMALL_INT((uint32_t)_firmware_size);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start);