Просмотр исходного кода

update: LICENSE更新一下年份, 修正一下luat_shell_push的类型错误

Wendal Chen 4 лет назад
Родитель
Сommit
0ec5ab89fb
3 измененных файлов с 7 добавлено и 4 удалено
  1. 1 1
      LICENSE
  2. 4 1
      bsp/win32/port/luat_log_win32.c
  3. 2 2
      luat/modules/luat_shell.c

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2019 openLuat
+Copyright (c) 2019-2022 openLuat & AirM2M
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 4 - 1
bsp/win32/port/luat_log_win32.c

@@ -56,7 +56,10 @@ void luat_nprint(char *s, size_t l) {
     };
     xQueueSendFromISR(xQueue, &msg, NULL);
 #else
-    printf("%s", s);
+    char buff[4*1024];
+    memcpy(buff, s, l);
+    buff[l] = 0;
+    printf("%s", buff);
 #endif
 }
 

+ 2 - 2
luat/modules/luat_shell.c

@@ -140,7 +140,7 @@ static int luat_shell_loadstr(lua_State *L, void* ptr) {
 
 void luat_shell_push(char* uart_buff, size_t rcount) {
     //int ret = 0;
-    int len = 0;
+    size_t len = 0;
     char buff[128] = {0};
     if (rcount) {
         if (cmux_state == 1){
@@ -148,7 +148,7 @@ void luat_shell_push(char* uart_buff, size_t rcount) {
         }else{
             // 是不是ATI命令呢?
             if (echo_enable)
-            luat_shell_write(uart_buff, rcount);
+                luat_shell_write(uart_buff, rcount);
             // 查询版本号
             if (strncmp("ATI", uart_buff, 3) == 0 || strncmp("ati", uart_buff, 3) == 0) {
                 #ifdef LUAT_BSP_VERSION