summaryrefslogtreecommitdiff
path: root/cc3200/boards
diff options
context:
space:
mode:
authorDaniel Campora <daniel@wipy.io>2015-09-14 20:03:32 +0200
committerDaniel Campora <daniel@wipy.io>2015-09-16 10:10:38 +0200
commit22b4c28f854bb2066a0d7471b50f9e00e1363239 (patch)
treeeeedc24a49a3f8c5a3cfa8fe0eed83a7788c9584 /cc3200/boards
parent0e52d9860adc2d3d7328c649f3b6995ffc04fc63 (diff)
cc3200: New ADC API.
Diffstat (limited to 'cc3200/boards')
-rw-r--r--cc3200/boards/make-pins.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/cc3200/boards/make-pins.py b/cc3200/boards/make-pins.py
index 884f72cf9..676896803 100644
--- a/cc3200/boards/make-pins.py
+++ b/cc3200/boards/make-pins.py
@@ -35,6 +35,8 @@ class AF:
def __init__(self, name, idx, fn, unit, type):
self.name = name
self.idx = idx
+ if self.idx > 15:
+ self.idx = -1
self.fn = fn
self.unit = unit
self.type = type
@@ -57,12 +59,16 @@ class Pin:
def print(self):
print('// {}'.format(self.name))
- print('const pin_af_t pin_{}_af[] = {{'.format(self.name))
- for af in self.afs:
- af.print()
- print('};')
- print('pin_obj_t pin_{:4s} = PIN({:6s}, {:1d}, {:3d}, {:2d}, pin_{}_af, {});\n'.format(
- self.name, self.name, self.port, self.gpio_bit, self.pin_num, self.name, len(self.afs)))
+ if len(self.afs):
+ print('const pin_af_t pin_{}_af[] = {{'.format(self.name))
+ for af in self.afs:
+ af.print()
+ print('};')
+ print('pin_obj_t pin_{:4s} = PIN({:6s}, {:1d}, {:3d}, {:2d}, pin_{}_af, {});\n'.format(
+ self.name, self.name, self.port, self.gpio_bit, self.pin_num, self.name, len(self.afs)))
+ else:
+ print('pin_obj_t pin_{:4s} = PIN({:6s}, {:1d}, {:3d}, {:2d}, NULL, 0);\n'.format(
+ self.name, self.name, self.port, self.gpio_bit, self.pin_num))
def print_header(self, hdr_file):
hdr_file.write('extern pin_obj_t pin_{:s};\n'.format(self.name))