Merge branch 'master' of github.com:micropython/micropython
This commit is contained in:
commit
5f82b50324
@ -54,4 +54,6 @@ STRIP = $(CROSS_COMPILE)strip
|
|||||||
all:
|
all:
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
|
||||||
MKENV_INCLUDED = 1
|
MKENV_INCLUDED = 1
|
||||||
|
@ -38,7 +38,10 @@
|
|||||||
// These are needed to support removal of the medium, so that the USB drive
|
// These are needed to support removal of the medium, so that the USB drive
|
||||||
// can be unmounted, and won't be remounted automatically.
|
// can be unmounted, and won't be remounted automatically.
|
||||||
static uint8_t flash_removed = 0;
|
static uint8_t flash_removed = 0;
|
||||||
|
|
||||||
|
#if MICROPY_HW_HAS_SDCARD
|
||||||
static uint8_t sdcard_removed = 0;
|
static uint8_t sdcard_removed = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
// Callback functions for when the internal flash is the mass storage device
|
// Callback functions for when the internal flash is the mass storage device
|
||||||
|
@ -61,6 +61,8 @@ STATIC ffi_type *char2ffi_type(char c)
|
|||||||
case 'I': return &ffi_type_uint;
|
case 'I': return &ffi_type_uint;
|
||||||
case 'l': return &ffi_type_slong;
|
case 'l': return &ffi_type_slong;
|
||||||
case 'L': return &ffi_type_ulong;
|
case 'L': return &ffi_type_ulong;
|
||||||
|
case 'f': return &ffi_type_float;
|
||||||
|
case 'd': return &ffi_type_double;
|
||||||
case 'p':
|
case 'p':
|
||||||
case 's': return &ffi_type_pointer;
|
case 's': return &ffi_type_pointer;
|
||||||
case 'v': return &ffi_type_void;
|
case 'v': return &ffi_type_void;
|
||||||
@ -92,6 +94,14 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type)
|
|||||||
}
|
}
|
||||||
case 'v':
|
case 'v':
|
||||||
return mp_const_none;
|
return mp_const_none;
|
||||||
|
case 'f': {
|
||||||
|
float *p = (float*)&val;
|
||||||
|
return mp_obj_new_float(*p);
|
||||||
|
}
|
||||||
|
case 'd': {
|
||||||
|
double *p = (double*)&val;
|
||||||
|
return mp_obj_new_float(*p);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return mp_obj_new_int(val);
|
return mp_obj_new_int(val);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user