Доработка. Работа над загрузкой флеш.

This commit is contained in:
MaD_CaT
2024-11-12 15:51:52 +03:00
parent 460cea7ade
commit d9bb79e261
3 changed files with 11 additions and 5 deletions

View File

@@ -14,7 +14,6 @@ config/name="uarep-ctl"
run/main_scene="res://scenes/tabs-switch/tab-switch.tscn"
config/features=PackedStringArray("4.3")
run/flush_stdout_on_print=true
run/max_fps=24
run/low_processor_mode=true
run/delta_smoothing=false
boot_splash/show_image=false

View File

@@ -113,6 +113,8 @@ func on_disconnect(tbl, selected_rows, unit_ems):
func on_btn_flash_read(btn):
await get_tree().create_timer(0.1).timeout
btn.pressed = false
for board in g_boards.values():
board.need_flash_rd = true
## Обработчик нажатия кнопки "Записать".
@@ -460,6 +462,7 @@ func on_data_ems_received(unit_ems):
active_board.state_board = active_board.READ
active_board.start_rw_kems(true)
elif board.online and board.read_done and board.need_flash_rd:
print_debug()
active_board = board
active_board.state_board = active_board.READ_FLASH
active_board.read_flash()

View File

@@ -141,9 +141,8 @@ LOAD_KEMS, WRITE_FLASH_END}
else:
state_cmd = WAIT
elif (state_cmd == READ_FLASH) and (unit_ems.cmd_code_rx == 51):
pass
#read_flash()
elif (state_cmd == READ_FLASH) and (unit_ems.cmd_code_rx == unit_ems.CmdCode.READ_FLASH_MP550):
on_read_flash()
elif (state_cmd == WRITE_FLASH_BEGIN) and (unit_ems.cmd_code_rx == 49):
pass
#write_flash()
@@ -212,5 +211,10 @@ LOAD_KEMS, WRITE_FLASH_END}
on_wr_device(cur_dev_num)
func read_flash():
unit_ems.send_flash(unit_ems.CmdCode.READ_FLASH, [], yemsconsts.NUM_BYTE_FROM_FLASH, id_board)
unit_ems.send_flash(unit_ems.CmdCode.READ_FLASH_MP550, [], yemsconsts.NUM_BYTE_FROM_FLASH, id_board)
state_cmd = READ_FLASH
func on_read_flash():
need_flash_rd = false
state_board = WAIT
print_debug(id_board)