Exemple #1
0
 def __init__(self,
              label='download', 
              type='shell'):
     super().__init__(label=label, 
                      type=type, 
                      command='python', 
                      args=[
                          cm.getConfig('keilbuild'),
                          cm.getConfig('keilpath') + '/UV4/UV4.exe',
                          '-f',
                          r"${config:uvprojxPath}"
                      ], 
                      group='test')
Exemple #2
0
 def __init__(self,
              label='build', 
              type='shell',
              rebuild=False,
              fileLocation=None):
     super().__init__(label=label, 
                      type=type, 
                      command='python', 
                      args=[
                          cm.getConfig('keilbuild'),
                          cm.getConfig('keilpath') + '/UV4/UV4.exe',
                          '-r' if rebuild else '-b',
                          r"${config:uvprojxPath}"
                      ], 
                      group='build')
     self._initProblemMatcher(fileLocation)
Exemple #3
0
 def __init__(self,
              label='open in keil', 
              type='shell'):
     super().__init__(label=label, 
                      type=type, 
                      command=cm.getConfig('keilpath') + '/UV4/UV4.exe', 
                      args=[
                          r"${config:uvprojxPath}"
                      ], 
                      group='test')
Exemple #4
0
    parser.add_argument('-f', '--file', type=str, help='work space file')

    return parser.parse_args()


if __name__ == "__main__":
    args = initArgs()

    if args.project and args.directory:
        directory = args.directory if args.directory else "./"
        code = Code()
        proj = MdkProj(os.path.join(directory, args.project))

        code.addFolder()

        code.updateSetting("keilpath", cm.getConfig("keilpath"))
        code.updateSetting('uvprojxPath', args.project)

        code.addLaunch(
            Code.JLinkLaunch(svdFile=os.path.join(
                cm.getConfig('keilpath'),
                os.path.join("ARM/Packs", proj.getSvdFile())),
                             executable=os.path.join(
                                 os.path.dirname(
                                     os.path.join(directory, args.project)),
                                 proj.getOutputFile()),
                             device=proj.getDeviceName()[:-2]))
        code.addLaunch(
            Code.STLinkLaunch(svdFile=os.path.join(
                cm.getConfig('keilpath'),
                os.path.join("ARM/Packs", proj.getSvdFile())),
Exemple #5
0
                        format='[%(asctime)s %(levelname)s] %(message)s',
                        datefmt='%d %b %Y %H:%M:%S')

    if args.update:
        cm.updateSource(args.source)
    elif args.upgrade:
        if args.project:
            proj = None
            if args.project.endswith(".uvprojx"):
                proj = MdkProj(args.project)
            if proj != None:
                proj.upgrade()
    elif args.config:
        if len(args.config) == 1:
            print("config %s: %s" %
                  (args.config[0], str(cm.getConfig(args.config[0]))))
        elif len(args.config) > 1:
            cm.updateConfig(args.config[0], args.config[1])
    elif args.list:
        pm.listPackages()
    elif args.install:
        if pm.install(args.install, args.source):
            logging.info("install package: %s success" % args.install)
        else:
            logging.error("install package: %s fail" % args.install)
    elif args.uninstall:
        if pm.uninstall(args.uninstall):
            logging.info("remove package: %s success" % args.uninstall)
        else:
            logging.error("remove package: %s fail" % args.uninstall)
    elif args.add: