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

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

This reverts commit c272f8f2e21e3a04bd9b303c75d6cbf0b6fe9a5d, reversing
changes made to 4ccfbbb7b5fec2aec5a6ec6af740cd8e5a2e767d.
wl 2 лет назад
Родитель
Сommit
fbb4a043d2
4 измененных файлов с 12 добавлено и 17 удалено
  1. 6 7
      demo/air780eg_gnsstest/main.lua
  2. 4 8
      demo/at24cxx/main.lua
  3. 1 1
      demo/jt808/socket_demo.lua
  4. 1 1
      script/libs/lbsLoc.lua

+ 6 - 7
demo/air780eg_gnsstest/main.lua

@@ -177,14 +177,13 @@ sys.taskInit(function()
 
         -- uart.write(gps_uart_id, "$CFGSYS\r\n")
         -- uart.write(gps_uart_id, "$CFGMSG,6,4\r\n")
-        log.info("RMC", json.encode(libgnss.getRmc(2) or {}, "7f"))
-        log.info("INT", libgnss.getIntLocation())
+        log.info("RMC", json.encode(libgnss.getRmc(2) or {}))
         -- log.info("GGA", libgnss.getGga(3))
-        -- log.info("GLL", json.encode(libgnss.getGll(2) or {}, "7f"))
-        -- log.info("GSA", json.encode(libgnss.getGsa(2) or {}, "7f"))
-        -- log.info("GSV", json.encode(libgnss.getGsv(2) or {}, "7f"))
-        -- log.info("VTG", json.encode(libgnss.getVtg(2) or {}, "7f"))
-        -- log.info("ZDA", json.encode(libgnss.getZda(2) or {}, "7f"))
+        -- log.info("GLL", json.encode(libgnss.getGll(2) or {}))
+        -- log.info("GSA", json.encode(libgnss.getGsa(2) or {}))
+        -- log.info("GSV", json.encode(libgnss.getGsv(2) or {}))
+        -- log.info("VTG", json.encode(libgnss.getVtg(2) or {}))
+        -- log.info("ZDA", json.encode(libgnss.getZda(2) or {}))
         -- log.info("date", os.date())
         log.info("sys", rtos.meminfo("sys"))
         log.info("lua", rtos.meminfo("lua"))

+ 4 - 8
demo/at24cxx/main.lua

@@ -12,19 +12,15 @@ local addr = 0x50
 local i2cid = 0
 
 sys.taskInit(function()
-    sys.wait(500)
     log.info("i2c initial",i2c.setup(i2cid))
     while true do
-        --当使用芯片为AT24C32及以上时,其地址命令为两个8bit地址,前为地址高八位,后为地址低八位
-        i2c.send(i2cid, addr, string.char(0x01, 0x00) .. "12345678")
+        i2c.writeReg(i2cid, addr, 0x01, "abcd1234")
         sys.wait(100)
-        --开始信号 --> 控制命令 -->。->读取数据 -->X --> 停止信号注:。处为等待响应,x为发送非应答;因读取时需要先写入读取地址所以需要先send
-        i2c.send(i2cid, addr, string.char(0x01, 0x00))
-        sys.wait(100)
-        local data = i2c.recv(i2cid, addr, 8)
-        log.info("i2c", "data2", data:toHex(), #data)
+        local data = i2c.readReg(i2cid, addr, 0x01, 8)
+        log.info("i2c", "data2",data:toHex(),data)
         sys.wait(1000)
     end
+
 end)
 
 -- 用户代码已结束---------------------------------------------

+ 1 - 1
demo/jt808/socket_demo.lua

@@ -149,7 +149,7 @@ local function socketTask(ip, port)
 	-- socket.config(netc, nil, true)
 	while true do
 		-- log.info(rtos.meminfo("sys"))
-		-- result = libnet.waitLink(d1Name, 0, netc)
+		result = libnet.waitLink(d1Name, 0, netc)
 		result = libnet.connect(d1Name, 15000, netc, ip, port)
 		-- result = libnet.connect(d1Name, 5000, netc, "112.125.89.8",34607)
 		d1Online = result

+ 1 - 1
script/libs/lbsLoc.lua

@@ -180,7 +180,7 @@ local function taskClient(cbFnc, reqAddr, timeout, productKey, host, port,reqTim
         if not netc then cbFnc(6) return end -- 创建socket失败
         socket.debug(netc, false)
         socket.config(netc, nil, true, nil)
-        -- result = libnet.waitLink(d1Name, 0, netc)
+        result = libnet.waitLink(d1Name, 0, netc)
         result = libnet.connect(d1Name, 5000, netc, host, port)
         if result then
             while true do