From e553ff2f7518ea00a2fb528a20bf783da0901525 Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Wed, 16 Apr 2014 10:01:17 -0700 Subject: [PATCH 1/3] Fix to allow usbd_msc_storage.c to compile when MICROPY_HW_HAS_SDCARD isn't defined. --- stmhal/usbd_msc_storage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stmhal/usbd_msc_storage.c b/stmhal/usbd_msc_storage.c index 0225a2a23c..2c0b29c1db 100644 --- a/stmhal/usbd_msc_storage.c +++ b/stmhal/usbd_msc_storage.c @@ -38,7 +38,10 @@ // These are needed to support removal of the medium, so that the USB drive // can be unmounted, and won't be remounted automatically. static uint8_t flash_removed = 0; + +#if MICROPY_HW_HAS_SDCARD static uint8_t sdcard_removed = 0; +#endif /******************************************************************************/ // Callback functions for when the internal flash is the mass storage device From 1a797edd3bfd94387b2f4c88ee9ed79d9c2172de Mon Sep 17 00:00:00 2001 From: Dave Hylands Date: Wed, 16 Apr 2014 08:09:59 -0700 Subject: [PATCH 2/3] Have make remove targets if a recipie fails. --- py/mkenv.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/mkenv.mk b/py/mkenv.mk index 8ae54f06bb..4bc71edd78 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -54,4 +54,6 @@ STRIP = $(CROSS_COMPILE)strip all: .PHONY: all +.DELETE_ON_ERROR: + MKENV_INCLUDED = 1 From f200c30d53f7fa0239e4ef48ffcbfcad5cf5406f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 17 Apr 2014 03:27:43 +0300 Subject: [PATCH 3/3] modffi: Support float types. --- unix/modffi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/unix/modffi.c b/unix/modffi.c index cb6a4424f3..f2bd6fcecf 100644 --- a/unix/modffi.c +++ b/unix/modffi.c @@ -61,6 +61,8 @@ STATIC ffi_type *char2ffi_type(char c) case 'I': return &ffi_type_uint; case 'l': return &ffi_type_slong; case 'L': return &ffi_type_ulong; + case 'f': return &ffi_type_float; + case 'd': return &ffi_type_double; case 'p': case 's': return &ffi_type_pointer; case 'v': return &ffi_type_void; @@ -92,6 +94,14 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type) } case 'v': 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: return mp_obj_new_int(val); }