serialhdl: Add a get_serialqueue() method

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2023-01-04 23:02:59 -05:00
parent a564824009
commit 4395ae96a7
2 changed files with 4 additions and 2 deletions

View File

@ -71,7 +71,7 @@ class MCU_trsync:
"trsync_state oid=%c can_trigger=%c trigger_reason=%c clock=%u") "trsync_state oid=%c can_trigger=%c trigger_reason=%c clock=%u")
ffi_main, ffi_lib = chelper.get_ffi() ffi_main, ffi_lib = chelper.get_ffi()
self._trdispatch_mcu = ffi_main.gc(ffi_lib.trdispatch_mcu_alloc( self._trdispatch_mcu = ffi_main.gc(ffi_lib.trdispatch_mcu_alloc(
self._trdispatch, mcu._serial.serialqueue, # XXX self._trdispatch, mcu._serial.get_serialqueue(), # XXX
self._cmd_queue, self._oid, set_timeout_tag, trigger_tag, self._cmd_queue, self._oid, set_timeout_tag, trigger_tag,
state_tag), ffi_lib.free) state_tag), ffi_lib.free)
def _shutdown(self): def _shutdown(self):
@ -746,7 +746,7 @@ class MCU:
raise error("Too few moves available on MCU '%s'" % (self._name,)) raise error("Too few moves available on MCU '%s'" % (self._name,))
ffi_main, ffi_lib = chelper.get_ffi() ffi_main, ffi_lib = chelper.get_ffi()
self._steppersync = ffi_main.gc( self._steppersync = ffi_main.gc(
ffi_lib.steppersync_alloc(self._serial.serialqueue, ffi_lib.steppersync_alloc(self._serial.get_serialqueue(),
self._stepqueues, len(self._stepqueues), self._stepqueues, len(self._stepqueues),
move_count-self._reserved_move_slots), move_count-self._reserved_move_slots),
ffi_lib.steppersync_free) ffi_lib.steppersync_free)

View File

@ -226,6 +226,8 @@ class SerialReader:
return self.reactor return self.reactor
def get_msgparser(self): def get_msgparser(self):
return self.msgparser return self.msgparser
def get_serialqueue(self):
return self.serialqueue
def get_default_command_queue(self): def get_default_command_queue(self):
return self.default_cmd_queue return self.default_cmd_queue
# Serial response callbacks # Serial response callbacks