Merge pull request #64 from lurch/no_power_pins

Don't allow overlays to include gound or power pins
This commit is contained in:
Philip Howard 2015-11-16 20:31:13 +00:00
commit 12bb053a84
1 changed files with 2 additions and 7 deletions

View File

@ -58,8 +58,6 @@ def load_overlay(overlay):
details.append('* ' + strings['pin_header'].format(pincount))
if 'pin' in loaded:
uses_5v = False
uses_3v = False
uses = 0
for pin in loaded['pin']:
pin = str(pin)
@ -69,11 +67,8 @@ def load_overlay(overlay):
if pin in pinout.pins:
actual_pin = pinout.pins[pin]
if actual_pin['type'] in ['+3v3', '+5v', 'GND']:
if actual_pin['type'] == '+3v3':
uses_3v = True
if actual_pin['type'] == '+5v':
uses_5v = True
if actual_pin['type'] in ['+3v3', '+5v', 'GND'] and overlay != 'ground':
raise Exception("{} includes a reference to a {} pin, which isn't allowed".format(overlay, actual_pin['type']))
else:
uses += 1