Skip to content

Commit

Permalink
Add checking if the new node is not the same as original mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vava24680 committed Jul 18, 2020
1 parent 0e761de commit 9ddeafb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RPi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def setmode(mode):
BOARD - Use Raspberry Pi board numbers
BCM - Use Broadcom GPIO 00..nn numbers
"""
if _State.mode != UNKNOWN:
if _State.mode != UNKNOWN and _State.mode != mode:
raise ValueError("A different mode has already been set!")

if mode != BCM and mode != BOARD:
Expand Down

0 comments on commit 9ddeafb

Please sign in to comment.