浏览代码

Merge branch 'master' of https://gitee.com/openLuat/LuatOS

alienwalker 2 年之前
父节点
当前提交
23d9d72daa

+ 4 - 4
components/minmea/luat_lib_libgnss.c

@@ -182,7 +182,7 @@ static void l_libgnss_uart_recv_cb(int uart_id, uint32_t data_len)
 @usage
 -- 解析nmea数据
 libgnss.parse(indata)
-log.info("nmea", json.encode(libgnss.getRmc()))
+log.info("nmea", json.encode(libgnss.getRmc(), "11g"))
  */
 static int l_libgnss_parse(lua_State *L) {
     size_t len = 0;
@@ -417,7 +417,7 @@ static int l_libgnss_get_gsv(lua_State *L) {
 @return table 原始GSA数据
 @usage
 -- 获取
-log.info("nmea", "gsa", json.encode(libgnss.getGsa()))
+log.info("nmea", "gsa", json.encode(libgnss.getGsa(), "11g"))
 -- 示例数据
 --[[
 {
@@ -623,7 +623,7 @@ static int l_libgnss_debug(lua_State *L) {
 @usage
 local gga = libgnss.getGga(2)
 if gga then
-    log.info("GGA", json.encode(gga))
+    log.info("GGA", json.encode(gga, "11g"))
 end
 --实例输出
 --[[
@@ -695,7 +695,7 @@ static int l_libgnss_get_gga(lua_State* L) {
 @usage
 local gll = libgnss.getGll(2)
 if gll then
-    log.info("GLL", json.encode(gll))
+    log.info("GLL", json.encode(gll, "11g"))
 end
 -- 实例数据
 --[[

+ 1 - 1
components/network/adapter/luat_network_adapter.c

@@ -1913,7 +1913,7 @@ int network_init_tls(network_ctrl_t *ctrl, int verify_mode)
 	ctrl->tls_timer_state = -1;
 	return 0;
 #else
-	LLOGE("NOT SUPPORT TLS");
+	DBG("NOT SUPPORT TLS");
 	return -1;
 #endif
 }

+ 2 - 2
components/ymodem/luat_ymodem.c

@@ -273,7 +273,7 @@ YMODEM_DATA_CHECK:
 						goto DATA_RECIEVE_ERROR;
 					}
 					LenEnd = ((ctrl->file_size - ctrl->write_size) > XMODEM_SOH_DATA_LEN)?XMODEM_SOH_DATA_LEN:(ctrl->file_size - ctrl->write_size);
-					luat_fs_fwrite(ctrl->packet_data, LenEnd, 1, ctrl->fd);
+					luat_fs_fwrite(ctrl->packet_data+3, LenEnd, 1, ctrl->fd);
 					ctrl->write_size += LenEnd;
 					goto DATA_RECIEVE_OK;
 					break;
@@ -294,7 +294,7 @@ YMODEM_DATA_CHECK:
 					}
 					//写入
 					LenEnd = ((ctrl->file_size - ctrl->write_size) > XMODEM_STX_DATA_LEN)?XMODEM_STX_DATA_LEN:(ctrl->file_size - ctrl->write_size);
-					luat_fs_fwrite(ctrl->packet_data, LenEnd, 1, ctrl->fd);
+					luat_fs_fwrite(ctrl->packet_data+3, LenEnd, 1, ctrl->fd);
 					ctrl->write_size += LenEnd;
 					goto DATA_RECIEVE_OK;
 					break;

+ 13 - 2
luat/vfs/luat_fs_fatfs.c

@@ -148,8 +148,19 @@ size_t luat_vfs_fatfs_fsize(void* userdata, const char *filename) {
 }
 
 int luat_vfs_fatfs_mkfs(void* userdata, luat_fs_conf_t *conf) {
-    LLOGE("not support yet : mkfs");
-    return -1;
+    (void)userdata;
+    (void)conf;
+    MKFS_PARM parm = {
+				.fmt = FM_ANY, // 暂时应付一下ramdisk
+				.au_size = 0,
+				.align = 0,
+				.n_fat = 0,
+				.n_root = 0,
+	};
+	BYTE work[FF_MAX_SS] = {0};
+	int re = f_mkfs("/", &parm, work, FF_MAX_SS);
+	LLOGD("format ret %d", re);
+    return re;
 }
 int luat_vfs_fatfs_mount(void** userdata, luat_fs_conf_t *conf) {
     *userdata = (void*)conf->busname;