stm32: Support compiling with object representation D.

With this and previous patches the stm32 port can now be compiled using
object representation D (nan boxing).  Note that native code and frozen mpy
files with float constants are currently not supported with this object
representation.
This commit is contained in:
Damien George
2018-07-08 23:25:11 +10:00
parent aa735dc6a4
commit e1ae9939ac
28 changed files with 276 additions and 276 deletions

View File

@@ -225,7 +225,7 @@ STATIC mp_obj_t pyb_flash_make_new(const mp_obj_type_t *type, size_t n_args, siz
mp_arg_check_num(n_args, n_kw, 0, 0, false);
// return singleton object
return (mp_obj_t)&pyb_flash_obj;
return MP_OBJ_FROM_PTR(&pyb_flash_obj);
}
STATIC mp_obj_t pyb_flash_readblocks(mp_obj_t self, mp_obj_t block_num, mp_obj_t buf) {
@@ -277,14 +277,14 @@ void pyb_flash_init_vfs(fs_user_mount_t *vfs) {
vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL;
vfs->fatfs.drv = vfs;
vfs->fatfs.part = 1; // flash filesystem lives on first partition
vfs->readblocks[0] = (mp_obj_t)&pyb_flash_readblocks_obj;
vfs->readblocks[1] = (mp_obj_t)&pyb_flash_obj;
vfs->readblocks[2] = (mp_obj_t)storage_read_blocks; // native version
vfs->writeblocks[0] = (mp_obj_t)&pyb_flash_writeblocks_obj;
vfs->writeblocks[1] = (mp_obj_t)&pyb_flash_obj;
vfs->writeblocks[2] = (mp_obj_t)storage_write_blocks; // native version
vfs->u.ioctl[0] = (mp_obj_t)&pyb_flash_ioctl_obj;
vfs->u.ioctl[1] = (mp_obj_t)&pyb_flash_obj;
vfs->readblocks[0] = MP_OBJ_FROM_PTR(&pyb_flash_readblocks_obj);
vfs->readblocks[1] = MP_OBJ_FROM_PTR(&pyb_flash_obj);
vfs->readblocks[2] = MP_OBJ_FROM_PTR(storage_read_blocks); // native version
vfs->writeblocks[0] = MP_OBJ_FROM_PTR(&pyb_flash_writeblocks_obj);
vfs->writeblocks[1] = MP_OBJ_FROM_PTR(&pyb_flash_obj);
vfs->writeblocks[2] = MP_OBJ_FROM_PTR(storage_write_blocks); // native version
vfs->u.ioctl[0] = MP_OBJ_FROM_PTR(&pyb_flash_ioctl_obj);
vfs->u.ioctl[1] = MP_OBJ_FROM_PTR(&pyb_flash_obj);
}
#endif