Explorar o código

Merge pull request #62 from SummerGGift/update_micropython

【完善】micropython 在 MDK || IAR 编译器下的错误与警告
朱天龙 (Armink) %!s(int64=6) %!d(string=hai) anos
pai
achega
e600466b98
Modificáronse 3 ficheiros con 7 adicións e 4 borrados
  1. 5 3
      port/machine_pin.c
  2. 1 1
      port/modffi.c
  3. 1 0
      port/modutime.c

+ 5 - 3
port/machine_pin.c

@@ -27,13 +27,13 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <string.h>
 #include <string.h>
-
 #include <rtthread.h>
 #include <rtthread.h>
 #include <drivers/pin.h>
 #include <drivers/pin.h>
-
 #include "py/runtime.h"
 #include "py/runtime.h"
 #include "py/gc.h"
 #include "py/gc.h"
 #include "py/mphal.h"
 #include "py/mphal.h"
+#include "py/mperrno.h"
+#include "py/stream.h"
 #include "modmachine.h"
 #include "modmachine.h"
 
 
 #if MICROPY_PY_PIN
 #if MICROPY_PY_PIN
@@ -219,7 +219,9 @@ STATIC mp_uint_t machine_pin_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
             return 0;
             return 0;
         }
         }
     }
     }
-    return -1;
+
+    *errcode = MP_EINVAL;
+    return MP_STREAM_ERROR;
 }
 }
 
 
 STATIC const mp_rom_map_elem_t machine_pin_locals_dict_table[] = {
 STATIC const mp_rom_map_elem_t machine_pin_locals_dict_table[] = {

+ 1 - 1
port/modffi.c

@@ -427,7 +427,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const
         ffi_arg retval;
         ffi_arg retval;
         ffi_call(self->func, &retval, n_args, values);
         ffi_call(self->func, &retval, n_args, values);
         m_free(values);
         m_free(values);
-        return return_ffi_value(retval, self->rettype);
+        return return_ffi_value((void *)retval, self->rettype);
     }
     }
 
 
 __error:
 __error:

+ 1 - 0
port/modutime.c

@@ -34,6 +34,7 @@
 #include "py/smallint.h"
 #include "py/smallint.h"
 #include "py/mphal.h"
 #include "py/mphal.h"
 #include "extmod/utime_mphal.h"
 #include "extmod/utime_mphal.h"
+#include "lib/timeutils/timeutils.h"
 
 
 STATIC mp_obj_t mod_time_time(void) {
 STATIC mp_obj_t mod_time_time(void) {
 #if MICROPY_PY_BUILTINS_FLOAT
 #if MICROPY_PY_BUILTINS_FLOAT