From d9bb79e2617c75e60c15646ef42ff4b4d600c03b Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Tue, 12 Nov 2024 15:51:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9=20=D1=84=D0=BB=D0=B5=D1=88.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.godot | 1 - scenes/эмс/эмс.gd | 3 +++ scripts/yems-boards.gd | 12 ++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/project.godot b/project.godot index 9481f5f4..eb35db35 100644 --- a/project.godot +++ b/project.godot @@ -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 diff --git a/scenes/эмс/эмс.gd b/scenes/эмс/эмс.gd index 4ffc3561..782a042f 100644 --- a/scenes/эмс/эмс.gd +++ b/scenes/эмс/эмс.gd @@ -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() diff --git a/scripts/yems-boards.gd b/scripts/yems-boards.gd index 41c4cf93..d7ac8e3e 100644 --- a/scripts/yems-boards.gd +++ b/scripts/yems-boards.gd @@ -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)