From 95a481418486d870f7934314606b84e25889cfce Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 5 Aug 2022 14:12:37 +0200 Subject: [PATCH] tools/litex_client: Improve run_gui termination. --- litex/tools/litex_client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litex/tools/litex_client.py b/litex/tools/litex_client.py index 38633cb26..c0f2afcc3 100644 --- a/litex/tools/litex_client.py +++ b/litex/tools/litex_client.py @@ -255,7 +255,7 @@ def run_gui(host, csr_csv, port): vccaux = gen_xadc_data(get_xadc_vccaux, n=xadc_points) vccbram = gen_xadc_data(get_xadc_vccbram, n=xadc_points) - while True: + while dpg.is_dearpygui_running(): # CSR Update. for name, reg in bus.regs.__dict__.items(): value = reg.read() @@ -282,8 +282,11 @@ def run_gui(host, csr_csv, port): timer_thread.start() dpg.show_viewport() - dpg.start_dearpygui() - dpg.destroy_context() + try: + while dpg.is_dearpygui_running(): + dpg.render_dearpygui_frame() + except KeyboardInterrupt: + dpg.destroy_context() bus.close()