我按照您的建议修改了初始化代码,但还是不起作用,每次开机都显示读不到字符串,必须重新初始化参数,会不会是这个API能保存的字符串长度是有限制的?
- local temp_string = read_flash_string(flash_addr. V2E)
- if temp_string ~= nil then
- print("Init flash data read Success! ")
- else
- print("no flash data on :".. flash_addr. V2E)
- -- Write initial parameters to flash
- save_table_to_flash(lookup_V2E,flash_addr. V2E)
- -- Read again
- temp_string = read_flash_string(flash_addr. V2E)
- print("temp_string:")
- print(temp_string)
- end
- print("lookup_V2E_flash data:")
复制代码
使用屏幕后面的debug口,记录到的打印信息好像不太对,字符串没有打印完全
- [17:38:47.549] MACC_Exit...
- [17:38:47.549] LUA: no flash data on :300
- [17:38:47.604] LUA: Length: 749
- [17:38:47.604] LUA: temp_string:
- [17:38:47.604] LUA: {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0.0966, -27.361, 600, 600, 600, 600, 600, 600, 0, 0}, {0.1118, -31.904, 600, 600, 600, 600, 600, 600, 550, 450}, {0.1927, -48.621, 600, 600, 500, 425, 285, 0, 0, 0}, {0.1822, -43.883, 600, 600, 500, 400, 0, 0, 0, 0}, {0.2469, -54.929, 550, 450, 350, 300, 0, 0, 0, 0}, {0.3576, -76.54, 450, 300, 250, 200, 0, 0, 0, 0}, {0.3796, -84.46, 450, 300, 250, 200, 0, 0, 0, 0}, {0.335, -68.99, 450, 300, 250, 200, 0, 0, 0, 0}, {0.373, -79.29, 450, 300, 250, 200, 0, 0, 0, 0}, {0.346LUA: lookup_V2E_flash data:
复制代码 |