print("BOARD " + boardname) # import the board def board = importlib.import_module(boardname) # Call the included board_specific file - it sets up 'pins' and 'fill_gaps' pins = board.get_pins() pins = pinutils.append_devices_to_pin_list(pins, board) # ----------------------------------------------------------------------------------------- # Documentation/functions jsondatas = common.get_jsondata(False, False, board) # ----------------------------------------------------------------------------------------- board.info["image_url"] = "http://www.espruino.com/img/" + boardname + ".jpg" board.info[ "thumb_url"] = "http://www.espruino.com/img/" + boardname + "_thumb.jpg" board.info["binary_version"] = common.get_version() board.info[ "binary_url"] = "http://www.espruino.com/binaries/" + common.get_board_binary_name( board) # ----------------------------------------------------------------------------------------- # Built-in modules builtinModules = [] for jsondata in jsondatas: if jsondata["type"] == "library": builtinModules.append(jsondata["class"]) board.info["builtin_modules"] = builtinModules # ----------------------------------------------------------------------------------------- pinperipherals = {} for pin in pins: if pin["name"][0] == 'P': pin["name"] = pin["name"][1:]
# ---------------------------------------------------------------------------------------- # Simple script to extract the user-friendly name of the board from boards/BOARDNAME.py # Used when auto-generating the website # ---------------------------------------------------------------------------------------- import subprocess; import re; import json; import sys; import os; import importlib; scriptdir = os.path.dirname(os.path.realpath(__file__)) basedir = scriptdir+"/../" sys.path.append(basedir+"scripts"); sys.path.append(basedir+"boards"); import common; import pinutils; # ----------------------------------------------------------------------------------------- # Now scan AF file if len(sys.argv)!=2: print "ERROR, USAGE: get_board_name.py BOARD_NAME" exit(1) boardname = sys.argv[1] # import the board def board = importlib.import_module(boardname) print common.get_board_binary_name(board)
jsonFilename = "boards/"+boardname+".json" print("JSON_FILENAME "+jsonFilename) print("BOARD "+boardname) # import the board def board = importlib.import_module(boardname) # Call the included board_specific file - it sets up 'pins' and 'fill_gaps' pins = board.get_pins() pins = pinutils.append_devices_to_pin_list(pins, board) # ----------------------------------------------------------------------------------------- # Documentation/functions jsondatas = common.get_jsondata(False, False, board) # ----------------------------------------------------------------------------------------- board.info["image_url"] = "http://www.espruino.com/img/"+boardname+".jpg" board.info["thumb_url"] = "http://www.espruino.com/img/"+boardname+"_thumb.jpg" board.info["binary_version"] = common.get_version(); board.info["binary_url"] = "http://www.espruino.com/binaries/"+common.get_board_binary_name(board) # ----------------------------------------------------------------------------------------- # Built-in modules builtinModules = [] for jsondata in jsondatas: if jsondata["type"]=="library": builtinModules.append(jsondata["class"]) board.info["builtin_modules"] = builtinModules # ----------------------------------------------------------------------------------------- pinperipherals = {} for pin in pins: if pin["name"][0] == 'P': pin["name"] = pin["name"][1:];
# ----------------------------------------------------------------------------------------- # Now scan AF file if len(sys.argv)!=2: print("ERROR, USAGE: get_makefile_decls.py BOARD_NAME") exit(1) boardname = sys.argv[1] # import the board def board = importlib.import_module(boardname) #print(json.dumps(board.info)) print("# Generated with scripts/get_makefile_decls.py "+boardname); print("BOARD="+boardname) binaryName=common.get_board_binary_name(board) if binaryName.find('.bin')>=0: binaryName = binaryName[:binaryName.find('.bin')] if binaryName.find('.hex')>=0: binaryName = binaryName[:binaryName.find('.hex')] print("PROJ_NAME="+binaryName) if board.chip["family"]!="LINUX": print("EMBEDDED=1") print("FAMILY="+board.chip['family']) print("CHIP="+board.chip['part']) if "optimizeflags" in board.info["build"]: if board.info["build"]["optimizeflags"]: print("OPTIMIZEFLAGS+="+board.info["build"]["optimizeflags"])
# ----------------------------------------------------------------------------------------- # Now scan AF file if len(sys.argv) != 2: print("ERROR, USAGE: get_makefile_decls.py BOARD_NAME") exit(1) boardname = sys.argv[1] # import the board def board = importlib.import_module(boardname) #print(json.dumps(board.info)) print("# Generated with scripts/get_makefile_decls.py " + boardname) print("BOARD=" + boardname) binaryName = common.get_board_binary_name(board) if binaryName.find('.bin') >= 0: binaryName = binaryName[:binaryName.find('.bin')] if binaryName.find('.hex') >= 0: binaryName = binaryName[:binaryName.find('.hex')] print("PROJ_NAME=" + binaryName) if board.chip["family"] != "LINUX": print("EMBEDDED=1") print("FAMILY=" + board.chip['family']) print("CHIP=" + board.chip['part']) if "optimizeflags" in board.info["build"]: if board.info["build"]["optimizeflags"]: print("OPTIMIZEFLAGS+=" + board.info["build"]["optimizeflags"])
# ---------------------------------------------------------------------------------------- # Simple script to extract the user-friendly name of the board from boards/BOARDNAME.py # Used when auto-generating the website # ---------------------------------------------------------------------------------------- import subprocess import re import json import sys import os import importlib scriptdir = os.path.dirname(os.path.realpath(__file__)) basedir = scriptdir + "/../" sys.path.append(basedir + "scripts") sys.path.append(basedir + "boards") import common import pinutils # ----------------------------------------------------------------------------------------- # Now scan AF file if len(sys.argv) != 2: print "ERROR, USAGE: get_board_name.py BOARD_NAME" exit(1) boardname = sys.argv[1] # import the board def board = importlib.import_module(boardname) print common.get_board_binary_name(board)