From 4810328cf4489e5cacc80bff678b5df1fee71c45 Mon Sep 17 00:00:00 2001 From: Decidedly Gray Date: Sat, 25 Sep 2021 14:39:13 -0500 Subject: [PATCH] Clarifying init failure location Propose adding additional context for init failures to help debugging (related to #49) --- cancat/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cancat/__init__.py b/cancat/__init__.py index 0abf2e2..f8fabd0 100644 --- a/cancat/__init__.py +++ b/cancat/__init__.py @@ -805,7 +805,7 @@ def setCanBaud(self, baud_const=CAN_500KBPS): self._config['can_baud'] = baud_const while(response[1] != b'\x01'): - print("CAN INIT FAILED: Retrying") + print("CAN INIT FAILED WHILE SETTING BAUD RATE: Retrying") response = self.recv(CMD_CAN_BAUD_RESULT, wait=30) def setCanMode(self, mode): @@ -824,10 +824,9 @@ def setCanMode(self, mode): response = self.recv(CMD_CAN_MODE_RESULT, wait=30) while(response[1] != b'\x01'): - print("CAN INIT FAILED: Retrying") + print("CAN INIT FAILED WHILE SETTING MODE: Retrying") response = self.recv(CMD_CAN_MODE_RESULT, wait=30) - self._config['can_mode'] = mode return response