summaryrefslogtreecommitdiffstats
path: root/libtoprammer/chips/microchip8
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-10-06 21:20:21 +0200
committerMichael Buesch <m@bues.ch>2013-10-06 21:20:21 +0200
commit9d8499af2c05a7a71adb75113a1c7d7a3d9bd8d0 (patch)
tree5997204d10d72dda925663909612de4825498454 /libtoprammer/chips/microchip8
parent0f2c0aa2858be1d2c94dac3b88174f3fa163a102 (diff)
downloadtoprammer-9d8499af2c05a7a71adb75113a1c7d7a3d9bd8d0.tar.xz
toprammer-9d8499af2c05a7a71adb75113a1c7d7a3d9bd8d0.zip
Remove makeSip6.py helperscript
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/chips/microchip8')
-rw-r--r--libtoprammer/chips/microchip8/makeSip6.py74
1 files changed, 0 insertions, 74 deletions
diff --git a/libtoprammer/chips/microchip8/makeSip6.py b/libtoprammer/chips/microchip8/makeSip6.py
deleted file mode 100644
index 8a72d0c..0000000
--- a/libtoprammer/chips/microchip8/makeSip6.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-
-"""
-# TOP2049 Open Source programming suite
-#
-# Commandline utility
-#
-# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""
-
-import re
-import sys
-import os
-
-def substitute(input, oldSocket, newSocket):
- input = re.sub('(^\s*packages).*', lambda m:'{} = (("DIP10", ""), ),'.format(m.group(1)), input)
- input = re.sub('(^\s*chipPackage).*', lambda m:'{} = "DIP10",'.format(m.group(1)), input)
- input = re.sub('(^\s*chipPinVCC).*', lambda m:'{} = 9,'.format(m.group(1)), input)
- input = re.sub('(^\s*chipPinsVPP).*', lambda m:'{} = 10,'.format(m.group(1)), input)
- input = re.sub('(^\s*chipPinGND).*', lambda m:'{} = 8,'.format(m.group(1)), input)
- input = re.sub('(^\s*runtimeID).*', lambda m:'{} = (0xDE05, 0x01),'.format(m.group(1)), input)
- input = re.sub('(^\s*description).+"(.*)".*', lambda m:'{} = "{} - ICD",'.format(m.group(1), m.group(2)), input)
- input = re.sub('(^\s*bitfile).*', lambda m:'{} = "microchip01sip6",'.format(m.group(1)), input)
- input = re.sub("{}".format(oldSocket), "{}".format(newSocket), input)
- return input
-
-
-def makeSip():
- inputFileName = '__init__.py'
- fin = open(inputFileName)
- # from pic16f1824dip14 import *
- dMCU = {}
- for line in fin:
- matchObj = re.match('#do not edit the text below this line.*', line)
- if matchObj:
- break
- matchObj = re.match('.*(pic[0-9]+l?f\w+)(dip[0-9a]+).*', line)
- if not matchObj:
- print("{} did not match".format(line))
- continue
- print('matched {} - {}'.format(matchObj.group(1), matchObj.group(2)))
- dMCU.setdefault(matchObj.group(1), matchObj.group(2))
- fin.close()
- finit = open("init", "a")
- for item in dMCU.items():
- fin = open("{}{}.py".format(item[0], item[1]))
- fout = open("{}sip6.py".format(item[0]), 'w')
- for line in fin:
- fout.write(substitute(line, "{}".format(item[1]), "sip6"))
- fout.close()
- fin.close()
- finit.write("from {}sip6 import *\n".format(item[0]))
- finit.close()
- print ('{} - {}'.format(item[0], item[1]))
-
-def main(argv):
- makeSip()
-
-if __name__ == "__main__":
- exit(main(sys.argv))
bues.ch cgit interface