Ver código fonte

【修改】port 中的 print 为 rt_kprintf 。

Signed-off-by: armink <armink.ztl@gmail.com>
armink 8 anos atrás
pai
commit
026a375ed3
2 arquivos alterados com 11 adições e 11 exclusões
  1. 10 10
      port/modmachine.c
  2. 1 1
      port/mpy_main.c

+ 10 - 10
port/modmachine.c

@@ -49,9 +49,9 @@ STATIC mp_obj_t machine_info(uint n_args, const mp_obj_t *args) {
 #endif
     // RT-Thread info
     {
-        printf("---------------------------------------------\n");
-        printf("RT-Thread\n");
-        printf("---------------------------------------------\n");
+        rt_kprintf("---------------------------------------------\n");
+        rt_kprintf("RT-Thread\n");
+        rt_kprintf("---------------------------------------------\n");
 
 #ifdef RT_USING_FINSH
         extern void list_mem(void);
@@ -65,25 +65,25 @@ STATIC mp_obj_t machine_info(uint n_args, const mp_obj_t *args) {
 
         list_thread();
 #endif
-        printf("---------------------------------------------\n");
+        rt_kprintf("---------------------------------------------\n");
     }
 
     // qstr info
     {
         mp_uint_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes;
         qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes);
-        printf("qstr:\n  n_pool=" UINT_FMT "\n  n_qstr=" UINT_FMT "\n  n_str_data_bytes=" UINT_FMT "\n  n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
+        rt_kprintf("qstr:\n  n_pool=" UINT_FMT "\n  n_qstr=" UINT_FMT "\n  n_str_data_bytes=" UINT_FMT "\n  n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
     }
-    printf("---------------------------------------------\n");
+    rt_kprintf("---------------------------------------------\n");
 
     // GC info
     {
         gc_info_t info;
         gc_info(&info);
-        printf("GC:\n");
-        printf("  " UINT_FMT " total\n", info.total);
-        printf("  " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
-        printf("  1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
+        rt_kprintf("GC:\n");
+        rt_kprintf("  " UINT_FMT " total\n", info.total);
+        rt_kprintf("  " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
+        rt_kprintf("  1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
     }
 
     // free space on flash

+ 1 - 1
port/mpy_main.c

@@ -151,7 +151,7 @@ NORETURN void nlr_jump_fail(void *val) {
 
 #ifndef NDEBUG
 void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
-    printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
+    rt_kprintf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
     RT_ASSERT(0);
 }
 #endif