Skip to content

Commit

Permalink
Merge pull request #858 from flit/bugfix/rtx5_invalid_state
Browse files Browse the repository at this point in the history
Handle invalid RTX5 thread state in description property.
  • Loading branch information
flit authored Apr 27, 2020
2 parents 96458d9 + 719afa8 commit 860b61c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyocd/rtos/rtx5.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def read_core_registers_raw(self, reg_list):
return reg_vals

class RTXTargetThread(TargetThread):
"""! @brief Base class representing a thread on the target."""
"""! @brief Represents an RTX5 thread on the target."""

STATE_OFFSET = 1
NAME_OFFSET = 4
Expand Down Expand Up @@ -278,7 +278,7 @@ def context(self):

@property
def description(self):
return "%s; Priority %d" % (self.STATES[self._state], self.priority)
return "%s; Priority %d" % (self.STATES.get(self._state, "(Invalid)"), self.priority)

@property
def name(self):
Expand Down

0 comments on commit 860b61c

Please sign in to comment.