mtk_class: Use serial_handshake if serialportname provided

- Fixes:

EP_OUT = self.cdc.EP_OUT.write
^^^^^^^^^^^^^^^
AttributeError: 'serial_class' object has no attribute 'EP_OUT'
This commit is contained in:
Kshitij Gupta 2024-05-30 13:23:53 +05:30
parent 31819b814d
commit 9e54803fb5

View file

@ -202,7 +202,10 @@ class Mtk(metaclass=LogBase):
self.config.payloadfile = os.path.join(self.pathconfig.get_payloads_path(),
self.config.chipconfig.loader)
if plt.runpayload(filename=self.config.payloadfile):
mtk.port.run_handshake()
if mtk.serialportname:
mtk.port.serial_handshake()
else:
mtk.port.handshake()
return mtk
else:
self.error("Error on running kamakiri payload")