Daiki Kato / mbed-os-lychee

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Committer:
dkato
Date:
Fri Feb 02 05:42:23 2018 +0000
Revision:
0:f782d9c66c49
mbed-os for GR-LYCHEE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:f782d9c66c49 1 """The generic interface for all exporters.
dkato 0:f782d9c66c49 2 """
dkato 0:f782d9c66c49 3 # mbed SDK
dkato 0:f782d9c66c49 4 # Copyright (c) 2011-2016 ARM Limited
dkato 0:f782d9c66c49 5 #
dkato 0:f782d9c66c49 6 # Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:f782d9c66c49 7 # you may not use this file except in compliance with the License.
dkato 0:f782d9c66c49 8 # You may obtain a copy of the License at
dkato 0:f782d9c66c49 9 #
dkato 0:f782d9c66c49 10 # http://www.apache.org/licenses/LICENSE-2.0
dkato 0:f782d9c66c49 11 #
dkato 0:f782d9c66c49 12 # Unless required by applicable law or agreed to in writing, software
dkato 0:f782d9c66c49 13 # distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:f782d9c66c49 14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:f782d9c66c49 15 # See the License for the specific language governing permissions and
dkato 0:f782d9c66c49 16 # limitations under the License.
dkato 0:f782d9c66c49 17
dkato 0:f782d9c66c49 18 from tools.export import lpcxpresso, ds5_5, iar, makefile
dkato 0:f782d9c66c49 19 from tools.export import embitz, coide, kds, simplicity, atmelstudio
dkato 0:f782d9c66c49 20 from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt
dkato 0:f782d9c66c49 21 from tools.export import gnuarmeclipse
dkato 0:f782d9c66c49 22 from tools.targets import TARGET_NAMES
dkato 0:f782d9c66c49 23
dkato 0:f782d9c66c49 24 EXPORTERS = {
dkato 0:f782d9c66c49 25 'uvision5': uvision.Uvision,
dkato 0:f782d9c66c49 26 'uvision': uvision.Uvision,
dkato 0:f782d9c66c49 27 'lpcxpresso': lpcxpresso.LPCXpresso,
dkato 0:f782d9c66c49 28 'gcc_arm': makefile.GccArm,
dkato 0:f782d9c66c49 29 'make_gcc_arm': makefile.GccArm,
dkato 0:f782d9c66c49 30 'make_armc5': makefile.Armc5,
dkato 0:f782d9c66c49 31 'make_iar': makefile.IAR,
dkato 0:f782d9c66c49 32 'ds5_5': ds5_5.DS5_5,
dkato 0:f782d9c66c49 33 'iar': iar.IAR,
dkato 0:f782d9c66c49 34 'embitz' : embitz.EmBitz,
dkato 0:f782d9c66c49 35 'coide' : coide.CoIDE,
dkato 0:f782d9c66c49 36 'kds' : kds.KDS,
dkato 0:f782d9c66c49 37 'simplicityv3' : simplicity.SimplicityV3,
dkato 0:f782d9c66c49 38 'atmelstudio' : atmelstudio.AtmelStudio,
dkato 0:f782d9c66c49 39 'sw4stm32' : sw4stm32.Sw4STM32,
dkato 0:f782d9c66c49 40 'e2studio' : e2studio.E2Studio,
dkato 0:f782d9c66c49 41 'eclipse_gcc_arm' : cdt.EclipseGcc,
dkato 0:f782d9c66c49 42 'eclipse_iar' : cdt.EclipseIAR,
dkato 0:f782d9c66c49 43 'eclipse_armc5' : cdt.EclipseArmc5,
dkato 0:f782d9c66c49 44 'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse,
dkato 0:f782d9c66c49 45 'zip' : zip.ZIP,
dkato 0:f782d9c66c49 46 'cmsis' : cmsis.CMSIS
dkato 0:f782d9c66c49 47 }
dkato 0:f782d9c66c49 48
dkato 0:f782d9c66c49 49 ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN = """
dkato 0:f782d9c66c49 50 Sorry, the target %s is not currently supported on the %s toolchain.
dkato 0:f782d9c66c49 51 Please refer to <a href='/handbook/Exporting-to-offline-toolchains' target='_blank'>Exporting to offline toolchains</a> for more information.
dkato 0:f782d9c66c49 52 """
dkato 0:f782d9c66c49 53
dkato 0:f782d9c66c49 54 ERROR_MESSAGE_NOT_EXPORT_LIBS = """
dkato 0:f782d9c66c49 55 To export this project please <a href='http://mbed.org/compiler/?import=http://mbed.org/users/mbed_official/code/mbed-export/k&mode=lib' target='_blank'>import the export version of the mbed library</a>.
dkato 0:f782d9c66c49 56 """
dkato 0:f782d9c66c49 57
dkato 0:f782d9c66c49 58 def mcu_ide_matrix(verbose_html=False):
dkato 0:f782d9c66c49 59 """Shows target map using prettytable
dkato 0:f782d9c66c49 60
dkato 0:f782d9c66c49 61 Keyword argumets:
dkato 0:f782d9c66c49 62 verbose_html - print the matrix in html format
dkato 0:f782d9c66c49 63 """
dkato 0:f782d9c66c49 64 supported_ides = sorted(EXPORTERS.keys())
dkato 0:f782d9c66c49 65 # Only use it in this function so building works without extra modules
dkato 0:f782d9c66c49 66 from prettytable import PrettyTable, ALL
dkato 0:f782d9c66c49 67
dkato 0:f782d9c66c49 68 # All tests status table print
dkato 0:f782d9c66c49 69 table_printer = PrettyTable(["Platform"] + supported_ides)
dkato 0:f782d9c66c49 70 # Align table
dkato 0:f782d9c66c49 71 for col in supported_ides:
dkato 0:f782d9c66c49 72 table_printer.align[col] = "c"
dkato 0:f782d9c66c49 73 table_printer.align["Platform"] = "l"
dkato 0:f782d9c66c49 74
dkato 0:f782d9c66c49 75 perm_counter = 0
dkato 0:f782d9c66c49 76 for target in sorted(TARGET_NAMES):
dkato 0:f782d9c66c49 77 row = [target] # First column is platform name
dkato 0:f782d9c66c49 78 for ide in supported_ides:
dkato 0:f782d9c66c49 79 text = "-"
dkato 0:f782d9c66c49 80 if target in EXPORTERS[ide].TARGETS:
dkato 0:f782d9c66c49 81 if verbose_html:
dkato 0:f782d9c66c49 82 text = "&#10003;"
dkato 0:f782d9c66c49 83 else:
dkato 0:f782d9c66c49 84 text = "x"
dkato 0:f782d9c66c49 85 perm_counter += 1
dkato 0:f782d9c66c49 86 row.append(text)
dkato 0:f782d9c66c49 87 table_printer.add_row(row)
dkato 0:f782d9c66c49 88
dkato 0:f782d9c66c49 89 table_printer.border = True
dkato 0:f782d9c66c49 90 table_printer.vrules = ALL
dkato 0:f782d9c66c49 91 table_printer.hrules = ALL
dkato 0:f782d9c66c49 92 # creates a html page in a shorter format suitable for readme.md
dkato 0:f782d9c66c49 93 if verbose_html:
dkato 0:f782d9c66c49 94 result = table_printer.get_html_string()
dkato 0:f782d9c66c49 95 else:
dkato 0:f782d9c66c49 96 result = table_printer.get_string()
dkato 0:f782d9c66c49 97 result += "\n"
dkato 0:f782d9c66c49 98 result += "Total IDEs: %d\n"% (len(supported_ides))
dkato 0:f782d9c66c49 99 if verbose_html:
dkato 0:f782d9c66c49 100 result += "<br>"
dkato 0:f782d9c66c49 101 result += "Total platforms: %d\n"% (len(TARGET_NAMES))
dkato 0:f782d9c66c49 102 if verbose_html:
dkato 0:f782d9c66c49 103 result += "<br>"
dkato 0:f782d9c66c49 104 result += "Total permutations: %d"% (perm_counter)
dkato 0:f782d9c66c49 105 if verbose_html:
dkato 0:f782d9c66c49 106 result = result.replace("&amp;", "&")
dkato 0:f782d9c66c49 107 return result