瀏覽代碼

Merge pull request #62 from SummerGGift/update_micropython

【完善】micropython 在 MDK || IAR 编译器下的错误与警告
朱天龙 (Armink) 6 年之前
父節點
當前提交
e600466b98
共有 3 個文件被更改,包括 7 次插入4 次删除
  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 <stdint.h>
 #include <string.h>
-
 #include <rtthread.h>
 #include <drivers/pin.h>
-
 #include "py/runtime.h"
 #include "py/gc.h"
 #include "py/mphal.h"
+#include "py/mperrno.h"
+#include "py/stream.h"
 #include "modmachine.h"
 
 #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 -1;
+
+    *errcode = MP_EINVAL;
+    return MP_STREAM_ERROR;
 }
 
 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_call(self->func, &retval, n_args, values);
         m_free(values);
-        return return_ffi_value(retval, self->rettype);
+        return return_ffi_value((void *)retval, self->rettype);
     }
 
 __error:

+ 1 - 0
port/modutime.c

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