aboutsummaryrefslogtreecommitdiff
path: root/driver_fw/gen_cmsis_exports.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-08-27 22:31:09 +0200
committerjaseg <git@jaseg.de>2023-08-27 22:31:09 +0200
commitec28fcd9f905358759eea98161f451567135d17e (patch)
treeed8f0f4f96811433ddca5f294f731c7584549a36 /driver_fw/gen_cmsis_exports.py
parent7c2cb09fad601facbb142d9378033d64d19b6488 (diff)
download8seg-ec28fcd9f905358759eea98161f451567135d17e.tar.gz
8seg-ec28fcd9f905358759eea98161f451567135d17e.tar.bz2
8seg-ec28fcd9f905358759eea98161f451567135d17e.zip
new driver blinkenlights
Diffstat (limited to 'driver_fw/gen_cmsis_exports.py')
-rw-r--r--driver_fw/gen_cmsis_exports.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/driver_fw/gen_cmsis_exports.py b/driver_fw/gen_cmsis_exports.py
deleted file mode 100644
index ba3422b..0000000
--- a/driver_fw/gen_cmsis_exports.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python3
-import re
-import os
-
-if __name__ == '__main__':
- import argparse
-
- parser = argparse.ArgumentParser()
- parser.add_argument('cmsis_device_header', nargs='+', type=argparse.FileType('rb'))
- args = parser.parse_args()
-
- print('#ifndef __GENERATED_CMSIS_HEADER_EXPORTS__')
- print('#define __GENERATED_CMSIS_HEADER_EXPORTS__')
- print()
- for header in args.cmsis_device_header:
- lines = header.readlines()
- name = os.path.basename(header.name)
- print('#include <{}>'.format(name))
- print()
-
- print('/* {} */'.format(name))
- for l in lines:
- match = re.match(b'^#define (\w+)\s+\W*(\w+_TypeDef|\w+_Type).*$', l)
- if match:
- inst, typedef = match.groups()
- inst, typedef = inst.decode(), typedef.decode()
- print('{} *{} = {};'.format(typedef, inst.lower(), inst))
- print()
- print('#endif//__GENERATED_CMSIS_HEADER_EXPORTS__')
-