def gen_debug(self, ksdkProj): """ Generate debug launch files """ # Get relative path atlPath = self.parent + ('' if self.parent[-1:] == '/' else '/') + self.name + '/atl' tree = ET.ElementTree(ET.fromstring(aF.project_board_debug_jlink_launch)) launchPath = atlPath + '/' + self.name + '_' + self.device[2] + ' debug jlink.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'jlinkDEVICE', self.device[0]) tree = ET.ElementTree(ET.fromstring(aF.project_board_release_jlink_launch)) launchPath = atlPath + '/' + self.name + '_' + self.device[2] + ' release jlink.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'jlinkDEVICE', self.device[0]) tree = ET.ElementTree(ET.fromstring(aF.project_board_debug_pne_launch)) launchPath = atlPath + '/' + self.name + '_' + self.device[2] + ' debug pne.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'pneDEVICE', self.device[0]) tree = ET.ElementTree(ET.fromstring(aF.project_board_release_pne_launch)) launchPath = atlPath + '/' + self.name + '_' + self.device[2] + ' release pne.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'pneDEVICE', self.device[0]) return
def gen_debug(self, ksdkProj): """ Generate debug launch files """ # Get relative path kdsPath = self.parent + ('' if self.parent[-1:] == '/' else '/') + self.name + '/kds' if not 'MKL' in self.device[2]: tree = ET.ElementTree(ET.fromstring(kF.project_board_debug_cmsisdap_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' debug cmsisdap.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) tree = ET.ElementTree(ET.fromstring(kF.project_board_release_cmsisdap_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' release cmsisdap.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) tree = ET.ElementTree(ET.fromstring(kF.project_board_debug_jlink_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' debug jlink.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'jlinkDEVICE', self.device[0]) tree = ET.ElementTree(ET.fromstring(kF.project_board_release_jlink_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' release jlink.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'jlinkDEVICE', self.device[0]) tree = ET.ElementTree(ET.fromstring(kF.project_board_debug_pne_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' debug pne.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'pneDEVICE', kT.string_replace(self.device[0][1:], 'xxx', 'M')) tree = ET.ElementTree(ET.fromstring(kF.project_board_release_pne_launch)) launchPath = kdsPath + '/' + self.name + '_' + self.device[2] + ' release pne.launch' tree.write(launchPath, "UTF-8") newStr = self.name + '_' + self.device[2] oldStr = 'project_board' kT.replace_name_in_file(launchPath, oldStr, newStr) kT.replace_name_in_file(launchPath, 'pneDEVICE', kT.string_replace(self.device[0][1:], 'xxx', 'M')) return