diff --git a/ports/gprs_a9/moduos.c b/ports/gprs_a9/moduos.c index 7230aef168a2..faf3a85ca1f4 100644 --- a/ports/gprs_a9/moduos.c +++ b/ports/gprs_a9/moduos.c @@ -337,7 +337,7 @@ mp_obj_t moduos_internal_flash_stat(mp_obj_t path_in) { // ======================================== const char* path = mp_obj_str_get_str(path_in); // check if folder - int32_t size = 0; + int64_t size = 0; Dir_t* folder = NULL; mp_int_t mode = 0; int32_t fd = NULL; @@ -347,8 +347,8 @@ mp_obj_t moduos_internal_flash_stat(mp_obj_t path_in) { mode = MP_S_IFDIR; } else if ((fd = API_FS_Open(path, FS_O_RDONLY, 0)) >= 0) { - API_FS_Close(fd); size = API_FS_GetFileSize(fd); + API_FS_Close(fd); mode = MP_S_IFREG; } else @@ -361,7 +361,7 @@ mp_obj_t moduos_internal_flash_stat(mp_obj_t path_in) { MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_NEW_SMALL_INT(0), - mp_obj_new_int(size), + mp_obj_new_int_from_uint(size), MP_OBJ_NEW_SMALL_INT(0x2821), MP_OBJ_NEW_SMALL_INT(0x2821), MP_OBJ_NEW_SMALL_INT(0x2821),