|
|
@@ -20,8 +20,12 @@ log.info("testSpiFlash.init",result)
|
|
|
sys.taskInit(function ()
|
|
|
sys.wait(5000)
|
|
|
while true do
|
|
|
- local command = string.fromHex("1D06bc000000")
|
|
|
- log.info("testSpiFlash.readFlashID",spi.send_recv(spi.SPI_1,command):toHex())--收发读写
|
|
|
+ local command = string.fromHex("1D0740000000")
|
|
|
+ local ret = spi.send_recv(spi.SPI_1,command):toHex()
|
|
|
+ log.info("testSpiFlash.readFlashID",ret)--收发读写 & string.fromHex("000000FFFFFF")
|
|
|
+ local lastFourChars = string.sub(ret, -4) -- 从倒数第四个字符到末尾
|
|
|
+ log.info("提取结果", lastFourChars) -- 输出: 1D0F
|
|
|
+
|
|
|
sys.wait(2000)
|
|
|
end
|
|
|
spi.close(spi.SPI_1)
|