summaryrefslogtreecommitdiffstatshomepage
path: root/cc3200/boards/make-pins.py
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-07-28 23:03:53 +0200
committerDaniel Campora <daniel@wipy.io>2015-07-30 00:43:08 +0200
commit007878781c74e0e4213759d8ee07ee81b5342f5c (patch)
treefb4ee36746826043ce18993b488ac42b370f5cfa /cc3200/boards/make-pins.py
parentcfc4c338015cb65a35228706c44485dd57ec238e (diff)
downloadmicropython-007878781c74e0e4213759d8ee07ee81b5342f5c.tar.gz
micropython-007878781c74e0e4213759d8ee07ee81b5342f5c.zip
cc3200: Rename pins from GPIO to just GP.
This is how the names will be printed on the sticker that goes on top of the EMI shield. The shorter names also help saving a few bytes of RAM and ROM.
Diffstat (limited to 'cc3200/boards/make-pins.py')
-rw-r--r--cc3200/boards/make-pins.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/cc3200/boards/make-pins.py b/cc3200/boards/make-pins.py
index 4d9257afdf..ac1a80be9b 100644
--- a/cc3200/boards/make-pins.py
+++ b/cc3200/boards/make-pins.py
@@ -10,14 +10,14 @@ import csv
def parse_port_pin(name_str):
"""Parses a string and returns a (port, gpio_bit) tuple."""
- if len(name_str) < 5:
- raise ValueError("Expecting pin name to be at least 5 characters")
- if name_str[:4] != 'GPIO':
- raise ValueError("Expecting pin name to start with GPIO")
- if not name_str[4:].isdigit():
+ if len(name_str) < 3:
+ raise ValueError("Expecting pin name to be at least 3 characters")
+ if name_str[:2] != 'GP':
+ raise ValueError("Expecting pin name to start with GP")
+ if not name_str[2:].isdigit():
raise ValueError("Expecting numeric GPIO number")
- port = int(int(name_str[4:]) / 8)
- gpio_bit = 1 << int(int(name_str[4:]) % 8)
+ port = int(int(name_str[2:]) / 8)
+ gpio_bit = 1 << int(int(name_str[2:]) % 8)
return (port, gpio_bit)