diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-10-24 01:03:17 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-10-24 16:52:15 +0300 |
commit | e6af94d13b9cac617ca7976027726f84b2c69c30 (patch) | |
tree | 94a446dcead7e02dab42a030bf2bb9a3310ec8c7 /esp8266/modesp.c | |
parent | 266e4acdc23609dac6810a98e16d677aebe3bc53 (diff) | |
download | micropython-e6af94d13b9cac617ca7976027726f84b2c69c30.tar.gz micropython-e6af94d13b9cac617ca7976027726f84b2c69c30.zip |
esp8266/modesp: Add flash_user_start() function.
As we're looking towards adding OTA support, calculation of a FlashROM
area which can be used for filesystem (etc.) may become complex, so
introduce C function for that. So far it just hardcodes current value,
0x90000. In the future the function may be extended (and renamed) to
return the size of area too.
Diffstat (limited to 'esp8266/modesp.c')
-rw-r--r-- | esp8266/modesp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 515319c9e0..827907d42b 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -629,6 +629,11 @@ STATIC mp_obj_t esp_flash_size(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_size_obj, esp_flash_size); +STATIC mp_obj_t esp_flash_user_start(void) { + return MP_OBJ_NEW_SMALL_INT(0x90000); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start); + STATIC mp_obj_t esp_check_fw(void) { MD5_CTX ctx; uint32_t *sz_p = (uint32_t*)0x40208ffc; @@ -706,6 +711,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_flash_write), (mp_obj_t)&esp_flash_write_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_flash_erase), (mp_obj_t)&esp_flash_erase_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_flash_size), (mp_obj_t)&esp_flash_size_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_flash_user_start), (mp_obj_t)&esp_flash_user_start_obj }, #if MODESP_ESPCONN { MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&esp_socket_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_getaddrinfo), (mp_obj_t)&esp_getaddrinfo_obj }, |