make script better conform to clang-format style
This commit is contained in:
parent
5668a80450
commit
d73ab01598
1 changed files with 7 additions and 8 deletions
15
mkcandata.py
15
mkcandata.py
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
def defines(name, suffix):
|
||||
print(f'const can_function {name} [] = {{')
|
||||
print(f'const can_function {name}[] = {{')
|
||||
for instance in (0, 1):
|
||||
for function in 'HI':
|
||||
for port in 'ABCD':
|
||||
|
|
@ -9,21 +9,20 @@ def defines(name, suffix):
|
|||
pin = f'P{port}{idx:02d}'
|
||||
pinmux = f'PINMUX_{pin}{function}_CAN{instance}_{suffix}'
|
||||
print(f'''\
|
||||
#if defined({pinmux}) && ! defined(IGNORE_PIN_{pin})
|
||||
#if defined({pinmux}) && !defined(IGNORE_PIN_{pin})
|
||||
{{PIN_{pin} >> 5, PIN_{pin} & 0x1f, {instance}, {pinmux} & 0xf}},
|
||||
#endif''')
|
||||
print(f'}};')
|
||||
print()
|
||||
|
||||
print('''\
|
||||
struct can_function {
|
||||
unsigned port:3;
|
||||
unsigned pin:5;
|
||||
unsigned instance:1;
|
||||
unsigned mux:4;
|
||||
unsigned port : 3;
|
||||
unsigned pin : 5;
|
||||
unsigned instance : 1;
|
||||
unsigned mux : 4;
|
||||
};
|
||||
|
||||
''')
|
||||
|
||||
defines('can_rx', 'RX')
|
||||
print()
|
||||
defines('can_tx', 'TX')
|
||||
|
|
|
|||
Loading…
Reference in a new issue