aboutsummaryrefslogtreecommitdiff
path: root/fw/tools
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2019-04-16 23:38:46 +0900
committerjaseg <git@jaseg.net>2019-04-16 23:38:46 +0900
commitf6b959086671fb1bf8b2003d5c5384c7311a7735 (patch)
tree1e06cf5a3c19900323d1f44dabd8a7ee14e2ec32 /fw/tools
parente79f3d4047aaf9beb8a59f1d30d93c78efae0cc5 (diff)
download8seg-f6b959086671fb1bf8b2003d5c5384c7311a7735.tar.gz
8seg-f6b959086671fb1bf8b2003d5c5384c7311a7735.tar.bz2
8seg-f6b959086671fb1bf8b2003d5c5384c7311a7735.zip
center/fw: rename
Diffstat (limited to 'fw/tools')
-rw-r--r--fw/tools/gen_cmsis_exports.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/fw/tools/gen_cmsis_exports.py b/fw/tools/gen_cmsis_exports.py
deleted file mode 100644
index ba3422b..0000000
--- a/fw/tools/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__')
-