From effc092b63c1b852f22bb2b7a2d4efa2bf062b29 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 16 Nov 2015 15:48:09 +0000 Subject: [PATCH 1/2] Don't allow overlays to include gound or power pins --- generate-html.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/generate-html.py b/generate-html.py index 4916d95..9c06eca 100755 --- a/generate-html.py +++ b/generate-html.py @@ -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 the {} pin, which isn't allowed".format(overlay, actual_pin['type'])) else: uses += 1 From 5a67a4702d331702587102d7a40c96a1a8ed868c Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 16 Nov 2015 15:52:23 +0000 Subject: [PATCH 2/2] Tweak wording --- generate-html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-html.py b/generate-html.py index 9c06eca..95c4bbc 100755 --- a/generate-html.py +++ b/generate-html.py @@ -68,7 +68,7 @@ def load_overlay(overlay): actual_pin = pinout.pins[pin] if actual_pin['type'] in ['+3v3', '+5v', 'GND'] and overlay != 'ground': - raise Exception("{} includes a reference to the {} pin, which isn't allowed".format(overlay, actual_pin['type'])) + raise Exception("{} includes a reference to a {} pin, which isn't allowed".format(overlay, actual_pin['type'])) else: uses += 1