Skip to content

Commit 967bb68

Browse files
committed
fix:supplement blcokly holding registers
1 parent b680d32 commit 967bb68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xarm/tools/blockly/_blockly_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _init_robot_main_class_codes(self, init=True, wait_seconds=1, mode=0, state=
164164
self._append_main_init_code(' self._holding_dict = {}')
165165

166166
if len(self._tgpio_digital_callbacks) or len(self._tgpio_analog_callbacks) or len(self._cgpio_digital_callbacks) or len(self._cgpio_analog_callbacks)\
167-
or len(self._count_callbacks):
167+
or len(self._count_callbacks) or len(self._holding_callbacks):
168168
self._append_main_init_code(' self._callback_in_thread = kwargs.get(\'callback_in_thread\', True)')
169169
self._append_main_init_code(' self._callback_que = queue.Queue()')
170170

@@ -193,6 +193,7 @@ def _init_robot_main_class_codes(self, init=True, wait_seconds=1, mode=0, state=
193193
self.__define_callback_thread_func()
194194
self.__define_listen_gpio_thread_func()
195195
self.__define_listen_count_thread_func()
196+
self.__define_listen_holding_registers_thread_func()
196197
self.__define_run_blockly_func()
197198
self.__define_robot_init_func(init=init, wait_seconds=wait_seconds, mode=mode, state=state, error_exit=error_exit, stop_exit=stop_exit)
198199
self.__define_error_warn_changed_callback_func(error_exit=error_exit)

0 commit comments

Comments
 (0)