Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #514 from j5api/better-arduino-runtime-errors
Browse files Browse the repository at this point in the history
Nicer messages for Runtime Errors in SBArduino
  • Loading branch information
tpoomlmly committed Jan 27, 2020
2 parents 6d9a12e + d762154 commit e235b18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions j5/backends/hardware/sb/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _command(self, command: str, *params: str) -> List[str]:

def _update_digital_pin(self, identifier: int) -> None:
if identifier >= FIRST_ANALOGUE_PIN:
raise RuntimeError("this should be unreachable")
raise RuntimeError("Reached an unreachable statement.")
pin = self._digital_pins[identifier]
char: str
if pin.mode == GPIOPinMode.DIGITAL_INPUT:
Expand All @@ -170,7 +170,7 @@ def _update_digital_pin(self, identifier: int) -> None:
else:
char = "L"
else:
raise RuntimeError("this should be unreachable")
raise RuntimeError("Reached an unreachable statement.")
self._command("W", str(identifier), char)

def set_gpio_pin_mode(self, identifier: int, pin_mode: GPIOPinMode) -> None:
Expand Down

0 comments on commit e235b18

Please sign in to comment.