Skip to content

Commit 51e294b

Browse files
committed
Merge branch 'same51'
2 parents a6915df + d73ab01 commit 51e294b

File tree

4 files changed

+1165
-1128
lines changed

4 files changed

+1165
-1128
lines changed

mkcandata.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#!/usr/bin/python3
22

33
def defines(name, suffix):
4-
print(f'const can_function {name} [] = {{')
4+
print(f'const can_function {name}[] = {{')
55
for instance in (0, 1):
66
for function in 'HI':
77
for port in 'ABCD':
88
for idx in range(32):
99
pin = f'P{port}{idx:02d}'
1010
pinmux = f'PINMUX_{pin}{function}_CAN{instance}_{suffix}'
1111
print(f'''\
12-
#if defined({pinmux}) && ! defined(IGNORE_PIN_{pin})
12+
#if defined({pinmux}) && !defined(IGNORE_PIN_{pin})
1313
{{PIN_{pin} >> 5, PIN_{pin} & 0x1f, {instance}, {pinmux} & 0xf}},
1414
#endif''')
1515
print(f'}};')
16-
print()
1716

1817
print('''\
1918
struct can_function {
20-
unsigned port:3;
21-
unsigned pin:5;
22-
unsigned instance:1;
23-
unsigned mux:4;
19+
unsigned port : 3;
20+
unsigned pin : 5;
21+
unsigned instance : 1;
22+
unsigned mux : 4;
2423
};
25-
2624
''')
2725

2826
defines('can_rx', 'RX')
27+
print()
2928
defines('can_tx', 'TX')

0 commit comments

Comments
 (0)