2015-11-26 10:34:24 -04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
2016-03-01 18:19:22 -04:00
|
|
|
from collections import OrderedDict
|
2018-03-01 05:11:29 -04:00
|
|
|
import sys, os
|
2015-11-26 10:34:24 -04:00
|
|
|
|
|
|
|
import waflib
|
2016-05-20 15:36:15 -03:00
|
|
|
from waflib.Configure import conf
|
2015-11-26 10:34:24 -04:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
_board_classes = {}
|
2018-01-05 02:53:19 -04:00
|
|
|
_board = None
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
class BoardMeta(type):
|
|
|
|
def __init__(cls, name, bases, dct):
|
|
|
|
super(BoardMeta, cls).__init__(name, bases, dct)
|
2016-03-11 08:54:30 -04:00
|
|
|
|
|
|
|
if 'abstract' not in cls.__dict__:
|
|
|
|
cls.abstract = False
|
|
|
|
if cls.abstract:
|
|
|
|
return
|
|
|
|
|
2016-03-15 14:55:30 -03:00
|
|
|
if not hasattr(cls, 'toolchain'):
|
|
|
|
cls.toolchain = 'native'
|
|
|
|
|
2016-02-24 15:59:25 -04:00
|
|
|
board_name = getattr(cls, 'name', name)
|
|
|
|
if board_name in _board_classes:
|
|
|
|
raise Exception('board named %s already exists' % board_name)
|
|
|
|
_board_classes[board_name] = cls
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
class Board:
|
2016-03-11 09:02:05 -04:00
|
|
|
abstract = True
|
|
|
|
|
2017-04-02 11:56:50 -03:00
|
|
|
def __init__(self):
|
|
|
|
self.with_uavcan = False
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
def configure(self, cfg):
|
2016-03-15 14:55:30 -03:00
|
|
|
cfg.env.TOOLCHAIN = self.toolchain
|
2018-07-01 20:34:44 -03:00
|
|
|
cfg.env.ROMFS_FILES = []
|
2016-03-15 14:07:37 -03:00
|
|
|
cfg.load('toolchain')
|
2016-05-19 17:00:29 -03:00
|
|
|
cfg.load('cxx_checks')
|
2016-03-15 14:07:37 -03:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env = waflib.ConfigSet.ConfigSet()
|
2016-02-22 14:26:02 -04:00
|
|
|
self.configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
d = env.get_merged_dict()
|
|
|
|
# Always prepend so that arguments passed in the command line get
|
|
|
|
# the priority.
|
|
|
|
for k, val in d.items():
|
|
|
|
# Dictionaries (like 'DEFINES') are converted to lists to
|
|
|
|
# conform to waf conventions.
|
|
|
|
if isinstance(val, dict):
|
2016-03-01 18:19:22 -04:00
|
|
|
keys = list(val.keys())
|
|
|
|
if not isinstance(val, OrderedDict):
|
|
|
|
keys.sort()
|
|
|
|
val = ['%s=%s' % (vk, val[vk]) for vk in keys]
|
|
|
|
|
2016-03-16 18:56:47 -03:00
|
|
|
if k in cfg.env and isinstance(cfg.env[k], list):
|
2016-02-15 17:26:14 -04:00
|
|
|
cfg.env.prepend_value(k, val)
|
2016-03-01 18:19:22 -04:00
|
|
|
else:
|
|
|
|
cfg.env[k] = val
|
2016-02-15 17:26:14 -04:00
|
|
|
|
2016-05-19 17:00:29 -03:00
|
|
|
cfg.ap_common_checks()
|
2016-04-05 17:09:48 -03:00
|
|
|
|
2016-09-02 23:37:00 -03:00
|
|
|
cfg.env.prepend_value('INCLUDES', [
|
|
|
|
cfg.srcnode.find_dir('libraries/AP_Common/missing').abspath()
|
|
|
|
])
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
2016-02-15 17:26:14 -04:00
|
|
|
# Use a dictionary instead of the convetional list for definitions to
|
|
|
|
# make easy to override them. Convert back to list before consumption.
|
|
|
|
env.DEFINES = {}
|
|
|
|
|
|
|
|
env.CFLAGS += [
|
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
'-fsigned-char',
|
|
|
|
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wshadow',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wcast-align',
|
2016-02-18 00:02:32 -04:00
|
|
|
'-Wundef',
|
2016-02-15 17:26:14 -04:00
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-redundant-decls',
|
2016-03-28 21:31:35 -03:00
|
|
|
'-Wno-unknown-pragmas',
|
2017-09-05 21:54:53 -03:00
|
|
|
'-Wno-trigraphs',
|
2016-02-15 17:26:14 -04:00
|
|
|
]
|
|
|
|
|
2016-03-08 19:43:27 -04:00
|
|
|
if 'clang' in cfg.env.COMPILER_CC:
|
|
|
|
env.CFLAGS += [
|
|
|
|
'-fcolor-diagnostics',
|
|
|
|
|
|
|
|
'-Wno-gnu-designator',
|
|
|
|
'-Wno-inconsistent-missing-override',
|
|
|
|
'-Wno-mismatched-tags',
|
|
|
|
'-Wno-gnu-variable-sized-type-not-at-end',
|
|
|
|
'-Wno-c++11-narrowing'
|
|
|
|
]
|
|
|
|
|
2016-05-06 18:44:12 -03:00
|
|
|
if cfg.env.DEBUG:
|
|
|
|
env.CFLAGS += [
|
|
|
|
'-g',
|
|
|
|
'-O0',
|
|
|
|
]
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-std=gnu++11',
|
|
|
|
|
|
|
|
'-fdata-sections',
|
|
|
|
'-ffunction-sections',
|
|
|
|
'-fno-exceptions',
|
|
|
|
'-fsigned-char',
|
|
|
|
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wshadow',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wcast-align',
|
2016-02-18 00:02:32 -04:00
|
|
|
'-Wundef',
|
2016-02-15 17:26:14 -04:00
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
'-Wno-reorder',
|
|
|
|
'-Wno-redundant-decls',
|
2016-03-28 21:31:35 -03:00
|
|
|
'-Wno-unknown-pragmas',
|
2016-02-15 17:26:14 -04:00
|
|
|
'-Werror=format-security',
|
|
|
|
'-Werror=array-bounds',
|
|
|
|
'-Werror=uninitialized',
|
|
|
|
'-Werror=init-self',
|
2017-04-19 07:10:52 -03:00
|
|
|
'-Werror=switch',
|
2018-06-26 21:50:15 -03:00
|
|
|
'-Werror=sign-compare',
|
2016-02-15 17:26:14 -04:00
|
|
|
'-Wfatal-errors',
|
2017-09-05 21:54:53 -03:00
|
|
|
'-Wno-trigraphs',
|
2016-02-15 17:26:14 -04:00
|
|
|
]
|
|
|
|
|
2016-03-08 19:43:27 -04:00
|
|
|
if 'clang++' in cfg.env.COMPILER_CXX:
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-fcolor-diagnostics',
|
|
|
|
|
|
|
|
'-Wno-gnu-designator',
|
|
|
|
'-Wno-inconsistent-missing-override',
|
|
|
|
'-Wno-mismatched-tags',
|
|
|
|
'-Wno-gnu-variable-sized-type-not-at-end',
|
|
|
|
'-Wno-c++11-narrowing'
|
|
|
|
]
|
|
|
|
else:
|
2016-07-18 15:25:36 -03:00
|
|
|
env.CXXFLAGS += [
|
2016-03-08 19:43:27 -04:00
|
|
|
'-Werror=unused-but-set-variable'
|
|
|
|
]
|
|
|
|
|
2016-05-06 18:44:12 -03:00
|
|
|
if cfg.env.DEBUG:
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-g',
|
|
|
|
'-O0',
|
|
|
|
]
|
|
|
|
|
2016-06-21 11:26:18 -03:00
|
|
|
if cfg.env.DEST_OS == 'darwin':
|
|
|
|
env.LINKFLAGS += [
|
|
|
|
'-Wl,-dead_strip',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
env.LINKFLAGS += [
|
|
|
|
'-Wl,--gc-sections',
|
|
|
|
]
|
|
|
|
|
2017-04-02 11:56:50 -03:00
|
|
|
if self.with_uavcan:
|
|
|
|
env.AP_LIBRARIES += [
|
|
|
|
'AP_UAVCAN',
|
|
|
|
'modules/uavcan/libuavcan/src/**/*.cpp'
|
|
|
|
]
|
|
|
|
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-Wno-error=cast-align',
|
|
|
|
]
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
UAVCAN_CPP_VERSION = 'UAVCAN_CPP03',
|
|
|
|
UAVCAN_NO_ASSERTIONS = 1,
|
|
|
|
UAVCAN_NULLPTR = 'nullptr'
|
|
|
|
)
|
|
|
|
|
|
|
|
env.INCLUDES += [
|
|
|
|
cfg.srcnode.find_dir('modules/uavcan/libuavcan/include').abspath()
|
|
|
|
]
|
|
|
|
|
2016-07-13 00:07:48 -03:00
|
|
|
# We always want to use PRI format macros
|
|
|
|
cfg.define('__STDC_FORMAT_MACROS', 1)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
|
2018-03-01 03:26:49 -04:00
|
|
|
def pre_build(self, bld):
|
|
|
|
'''pre-build hook that gets called before dynamic sources'''
|
2018-07-01 20:34:44 -03:00
|
|
|
if bld.env.ROMFS_FILES:
|
|
|
|
self.embed_ROMFS_files(bld)
|
2018-03-01 03:26:49 -04:00
|
|
|
|
2016-02-24 15:18:00 -04:00
|
|
|
def build(self, bld):
|
2016-05-05 19:16:23 -03:00
|
|
|
bld.ap_version_append_str('GIT_VERSION', bld.git_head_hash(short=True))
|
2018-01-05 02:53:19 -04:00
|
|
|
import time
|
|
|
|
ltime = time.localtime()
|
|
|
|
bld.ap_version_append_int('BUILD_DATE_YEAR', ltime.tm_year)
|
|
|
|
bld.ap_version_append_int('BUILD_DATE_MONTH', ltime.tm_mon)
|
|
|
|
bld.ap_version_append_int('BUILD_DATE_DAY', ltime.tm_mday)
|
2016-02-24 15:18:00 -04:00
|
|
|
|
2018-07-01 20:34:44 -03:00
|
|
|
def embed_ROMFS_files(self, ctx):
|
|
|
|
'''embed some files using AP_ROMFS'''
|
|
|
|
import embed
|
|
|
|
header = ctx.bldnode.make_node('ap_romfs_embedded.h').abspath()
|
|
|
|
if not embed.create_embedded_h(header, ctx.env.ROMFS_FILES):
|
|
|
|
bld.fatal("Failed to created ap_romfs_embedded.h")
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
Board = BoardMeta('Board', Board.__bases__, dict(Board.__dict__))
|
2015-11-26 10:34:24 -04:00
|
|
|
|
2018-03-01 05:11:29 -04:00
|
|
|
def add_dynamic_boards():
|
|
|
|
'''add boards based on existance of hwdef.dat in subdirectories for ChibiOS'''
|
|
|
|
dirname, dirlist, filenames = next(os.walk('libraries/AP_HAL_ChibiOS/hwdef'))
|
|
|
|
for d in dirlist:
|
|
|
|
if d in _board_classes.keys():
|
|
|
|
continue
|
|
|
|
hwdef = os.path.join(dirname, d, 'hwdef.dat')
|
|
|
|
if os.path.exists(hwdef):
|
|
|
|
newclass = type(d, (chibios,), {'name': d})
|
|
|
|
|
2015-11-26 12:32:27 -04:00
|
|
|
def get_boards_names():
|
2018-03-01 05:11:29 -04:00
|
|
|
add_dynamic_boards()
|
|
|
|
ret = sorted(list(_board_classes.keys()))
|
|
|
|
# some board types should not be selected
|
|
|
|
hidden = ['chibios']
|
|
|
|
for h in hidden:
|
|
|
|
if h in ret:
|
|
|
|
ret.remove(h)
|
|
|
|
return ret
|
2016-02-15 17:26:14 -04:00
|
|
|
|
2016-05-20 15:36:15 -03:00
|
|
|
@conf
|
|
|
|
def get_board(ctx):
|
2016-03-07 18:05:46 -04:00
|
|
|
global _board
|
|
|
|
if not _board:
|
2016-05-20 15:36:15 -03:00
|
|
|
if not ctx.env.BOARD:
|
|
|
|
ctx.fatal('BOARD environment variable must be set before first call to get_board()')
|
|
|
|
_board = _board_classes[ctx.env.BOARD]()
|
2016-03-07 18:05:46 -04:00
|
|
|
return _board
|
2015-11-26 10:34:24 -04:00
|
|
|
|
|
|
|
# NOTE: Keeping all the board definitions together so we can easily
|
|
|
|
# identify opportunities to simplify common flags. In the future might
|
|
|
|
# be worthy to keep board definitions in files of their own.
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class sitl(Board):
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(sitl, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD = 'HAL_BOARD_SITL',
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_NONE',
|
|
|
|
)
|
2016-05-06 18:44:12 -03:00
|
|
|
|
|
|
|
if not cfg.env.DEBUG:
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-O3',
|
|
|
|
]
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.LIB += [
|
|
|
|
'm',
|
|
|
|
]
|
2016-05-21 12:11:48 -03:00
|
|
|
|
|
|
|
cfg.check_librt(env)
|
2016-05-19 17:25:49 -03:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.LINKFLAGS += ['-pthread',]
|
|
|
|
env.AP_LIBRARIES += [
|
|
|
|
'AP_HAL_SITL',
|
|
|
|
'SITL',
|
|
|
|
]
|
|
|
|
|
2018-07-01 20:34:44 -03:00
|
|
|
if cfg.options.enable_sfml:
|
|
|
|
if not cfg.check_SFML(env):
|
|
|
|
cfg.fatal("Failed to find SFML libraries")
|
2018-07-01 07:10:08 -03:00
|
|
|
env.CXXFLAGS += ['-DWITH_SITL_OSD','-DOSD_ENABLED=ENABLED','-DHAL_HAVE_AP_ROMFS_EMBEDDED_H']
|
2018-07-09 05:02:53 -03:00
|
|
|
import fnmatch
|
|
|
|
for f in os.listdir('libraries/AP_OSD/fonts'):
|
|
|
|
if fnmatch.fnmatch(f, "font*bin"):
|
|
|
|
env.ROMFS_FILES += [(f,'libraries/AP_OSD/fonts/'+f)]
|
2018-07-01 07:10:08 -03:00
|
|
|
|
2016-04-19 01:12:42 -03:00
|
|
|
if sys.platform == 'cygwin':
|
|
|
|
env.LIB += [
|
|
|
|
'winmm',
|
|
|
|
]
|
2018-03-02 00:28:47 -04:00
|
|
|
env.CXXFLAGS += ['-DCYGWIN_BUILD']
|
2016-04-19 01:12:42 -03:00
|
|
|
|
2018-02-27 23:56:05 -04:00
|
|
|
|
|
|
|
if 'clang++' in cfg.env.COMPILER_CXX:
|
|
|
|
print("Disabling SLP for clang++")
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-fno-slp-vectorize' # compiler bug when trying to use SLP
|
|
|
|
]
|
2018-07-01 07:10:08 -03:00
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
class chibios(Board):
|
|
|
|
toolchain = 'arm-none-eabi'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(chibios, self).configure_env(cfg, env)
|
|
|
|
|
2018-01-12 21:29:11 -04:00
|
|
|
env.BOARD = self.name
|
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD = 'HAL_BOARD_CHIBIOS',
|
|
|
|
HAVE_OCLOEXEC = 0,
|
|
|
|
HAVE_STD_NULLPTR_T = 0,
|
|
|
|
)
|
|
|
|
|
|
|
|
env.AP_LIBRARIES += [
|
|
|
|
'AP_HAL_ChibiOS',
|
|
|
|
]
|
|
|
|
|
2018-02-05 18:47:23 -04:00
|
|
|
# make board name available for USB IDs
|
|
|
|
env.CHIBIOS_BOARD_NAME = 'HAL_BOARD_NAME="%s"' % self.name
|
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-Wlogical-op',
|
|
|
|
'-Wframe-larger-than=1300',
|
|
|
|
'-fsingle-precision-constant',
|
|
|
|
'-Wno-attributes',
|
|
|
|
'-Wno-error=double-promotion',
|
|
|
|
'-Wno-error=missing-declarations',
|
|
|
|
'-Wno-error=float-equal',
|
|
|
|
'-Wno-error=undef',
|
|
|
|
'-Wno-error=cpp',
|
|
|
|
'-Wno-cast-align',
|
|
|
|
'-fno-exceptions',
|
|
|
|
'-fno-rtti',
|
|
|
|
'-fno-threadsafe-statics',
|
|
|
|
'-Wall',
|
|
|
|
'-Wextra',
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
'-Wfloat-equal',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Werror=array-bounds',
|
|
|
|
'-Wfatal-errors',
|
|
|
|
'-Werror=unused-variable',
|
|
|
|
'-Werror=uninitialized',
|
|
|
|
'-Werror=init-self',
|
|
|
|
'-Wframe-larger-than=1024',
|
|
|
|
'-Werror=unused-but-set-variable',
|
|
|
|
'-Wno-missing-field-initializers',
|
2018-01-08 01:07:50 -04:00
|
|
|
'-Wno-trigraphs',
|
2018-01-05 02:53:19 -04:00
|
|
|
'-Os',
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
'-fomit-frame-pointer',
|
|
|
|
'-falign-functions=16',
|
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
'-fno-strength-reduce',
|
|
|
|
'-fno-builtin-printf',
|
|
|
|
'-fno-builtin-fprintf',
|
|
|
|
'-fno-builtin-vprintf',
|
|
|
|
'-fno-builtin-vfprintf',
|
|
|
|
'-fno-builtin-puts',
|
|
|
|
'-mcpu=cortex-m4',
|
|
|
|
'-mno-thumb-interwork',
|
|
|
|
'-mthumb',
|
|
|
|
'-mfpu=fpv4-sp-d16',
|
2018-06-29 04:54:06 -03:00
|
|
|
'-mfloat-abi=hard',
|
|
|
|
'-DCHIBIOS_BOARD_NAME="%s"' % self.name,
|
2018-01-05 02:53:19 -04:00
|
|
|
]
|
|
|
|
|
2018-03-02 00:28:47 -04:00
|
|
|
if sys.platform == 'cygwin':
|
|
|
|
env.CXXFLAGS += ['-DCYGWIN_BUILD']
|
|
|
|
|
2018-01-12 21:29:11 -04:00
|
|
|
bldnode = cfg.bldnode.make_node(self.name)
|
|
|
|
env.BUILDROOT = bldnode.make_node('').abspath()
|
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
env.LINKFLAGS = [
|
|
|
|
'-mcpu=cortex-m4',
|
|
|
|
'-Os',
|
|
|
|
'-fomit-frame-pointer',
|
|
|
|
'-falign-functions=16',
|
|
|
|
'-ffunction-sections',
|
|
|
|
'-fdata-sections',
|
|
|
|
'-u_port_lock',
|
|
|
|
'-u_port_unlock',
|
|
|
|
'-u_exit',
|
|
|
|
'-u_kill',
|
|
|
|
'-u_getpid',
|
|
|
|
'-u_errno',
|
|
|
|
'-uchThdExit',
|
|
|
|
'-u_printf_float',
|
|
|
|
'-fno-common',
|
|
|
|
'-nostartfiles',
|
|
|
|
'-mfloat-abi=hard',
|
|
|
|
'-mfpu=fpv4-sp-d16',
|
|
|
|
'-mno-thumb-interwork',
|
|
|
|
'-mthumb',
|
2018-03-02 01:27:40 -04:00
|
|
|
'-L%s' % env.BUILDROOT,
|
2018-01-12 21:29:11 -04:00
|
|
|
'-L%s' % cfg.srcnode.make_node('modules/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/').abspath(),
|
|
|
|
'-L%s' % cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/common/').abspath(),
|
2018-03-02 01:27:40 -04:00
|
|
|
'-Wl,--gc-sections,--no-warn-mismatch,--library-path=/ld,--script=ldscript.ld,--defsym=__process_stack_size__=0x400,--defsym=__main_stack_size__=0x400',
|
2018-01-05 02:53:19 -04:00
|
|
|
]
|
|
|
|
|
2018-05-03 22:23:05 -03:00
|
|
|
if cfg.env.DEBUG:
|
|
|
|
env.CFLAGS += [
|
|
|
|
'-g',
|
|
|
|
]
|
|
|
|
env.LINKFLAGS += [
|
|
|
|
'-g',
|
|
|
|
]
|
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
env.LIB += ['gcc', 'm']
|
2018-02-01 15:12:38 -04:00
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
env.GIT_SUBMODULES += [
|
|
|
|
'ChibiOS',
|
|
|
|
]
|
2018-07-01 21:30:46 -03:00
|
|
|
|
|
|
|
try:
|
|
|
|
import intelhex
|
|
|
|
env.HAVE_INTEL_HEX = True
|
|
|
|
cfg.msg("Checking for intelhex module:", 'OK')
|
|
|
|
except Exception:
|
|
|
|
cfg.msg("Checking for intelhex module:", 'disabled', color='YELLOW')
|
|
|
|
env.HAVE_INTEL_HEX = False
|
|
|
|
|
2018-01-05 02:53:19 -04:00
|
|
|
cfg.load('chibios')
|
|
|
|
|
|
|
|
def build(self, bld):
|
|
|
|
super(chibios, self).build(bld)
|
2018-06-12 00:33:42 -03:00
|
|
|
bld.ap_version_append_str('CHIBIOS_GIT_VERSION', bld.git_submodule_head_hash('ChibiOS', short=True))
|
2018-01-05 02:53:19 -04:00
|
|
|
bld.load('chibios')
|
|
|
|
|
2018-03-01 03:26:49 -04:00
|
|
|
def pre_build(self, bld):
|
|
|
|
'''pre-build hook that gets called before dynamic sources'''
|
2018-07-01 20:34:44 -03:00
|
|
|
super(chibios, self).pre_build(bld)
|
2018-03-01 03:26:49 -04:00
|
|
|
from waflib.Context import load_tool
|
|
|
|
module = load_tool('chibios', [], with_sys_path=True)
|
|
|
|
fun = getattr(module, 'pre_build', None)
|
|
|
|
if fun:
|
|
|
|
fun(bld)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class linux(Board):
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(linux, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
2016-08-02 16:50:04 -03:00
|
|
|
cfg.find_toolchain_program('pkg-config', var='PKGCONFIG')
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD = 'HAL_BOARD_LINUX',
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_NONE',
|
|
|
|
)
|
2016-05-06 18:44:12 -03:00
|
|
|
|
|
|
|
if not cfg.env.DEBUG:
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-O3',
|
|
|
|
]
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.LIB += [
|
|
|
|
'm',
|
|
|
|
]
|
2016-05-21 12:11:48 -03:00
|
|
|
|
|
|
|
cfg.check_librt(env)
|
2016-05-21 12:16:11 -03:00
|
|
|
cfg.check_lttng(env)
|
2016-07-12 23:33:10 -03:00
|
|
|
cfg.check_libdl(env)
|
2016-05-21 12:17:56 -03:00
|
|
|
cfg.check_libiio(env)
|
2016-05-19 17:25:49 -03:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
env.LINKFLAGS += ['-pthread',]
|
2017-06-05 08:29:18 -03:00
|
|
|
env.AP_LIBRARIES += [
|
2016-02-15 17:26:14 -04:00
|
|
|
'AP_HAL_Linux',
|
|
|
|
]
|
|
|
|
|
2017-06-06 11:13:49 -03:00
|
|
|
if self.with_uavcan:
|
|
|
|
cfg.define('UAVCAN_EXCEPTIONS', 0)
|
2018-03-28 02:25:42 -03:00
|
|
|
|
|
|
|
if cfg.options.apstatedir:
|
|
|
|
cfg.define('AP_STATEDIR', cfg.options.apstatedir)
|
|
|
|
|
2017-06-05 11:00:27 -03:00
|
|
|
def build(self, bld):
|
|
|
|
super(linux, self).build(bld)
|
|
|
|
if bld.options.upload:
|
|
|
|
waflib.Options.commands.append('rsync')
|
|
|
|
# Avoid infinite recursion
|
|
|
|
bld.options.upload = False
|
2016-06-25 12:40:08 -03:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class erleboard(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(erleboard, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD',
|
|
|
|
)
|
|
|
|
|
|
|
|
class navio(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(navio, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_NAVIO',
|
|
|
|
)
|
|
|
|
|
2016-02-25 08:43:01 -04:00
|
|
|
class navio2(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(navio2, self).configure_env(cfg, env)
|
2016-02-25 08:43:01 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_NAVIO2',
|
|
|
|
)
|
|
|
|
|
2016-06-28 10:43:47 -03:00
|
|
|
class edge(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2017-07-28 07:56:11 -03:00
|
|
|
def __init__(self):
|
|
|
|
self.with_uavcan = True
|
|
|
|
|
2016-06-28 10:43:47 -03:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(edge, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_EDGE',
|
|
|
|
)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class zynq(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-xilinx-linux-gnueabi'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(zynq, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_ZYNQ',
|
|
|
|
)
|
|
|
|
|
2017-08-17 19:40:16 -03:00
|
|
|
class ocpoc_zynq(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(ocpoc_zynq, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ',
|
|
|
|
)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class bbbmini(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(bbbmini, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_BBBMINI',
|
|
|
|
)
|
|
|
|
|
2016-12-29 10:29:02 -04:00
|
|
|
class blue(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(blue, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_BLUE',
|
|
|
|
)
|
|
|
|
|
2017-12-13 15:34:09 -04:00
|
|
|
class pocket(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(pocket, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_POCKET',
|
|
|
|
)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class pxf(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(pxf, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_PXF',
|
|
|
|
)
|
|
|
|
|
|
|
|
class bebop(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(bebop, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_BEBOP',
|
|
|
|
)
|
|
|
|
|
2016-06-06 19:13:56 -03:00
|
|
|
class disco(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(disco, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_DISCO',
|
|
|
|
)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class erlebrain2(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(erlebrain2, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2',
|
|
|
|
)
|
|
|
|
|
|
|
|
class bhat(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(bhat, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_BH',
|
|
|
|
)
|
|
|
|
|
2016-10-17 16:06:23 -03:00
|
|
|
class dark(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(dark, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_DARK',
|
|
|
|
)
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class pxfmini(linux):
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(pxfmini, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_PXFMINI',
|
|
|
|
)
|
2016-03-03 13:55:05 -04:00
|
|
|
|
2016-05-31 15:51:47 -03:00
|
|
|
class aero(linux):
|
2018-03-09 11:34:38 -04:00
|
|
|
def __init__(self):
|
|
|
|
self.with_uavcan = True
|
|
|
|
|
2016-05-31 15:51:47 -03:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(aero, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_AERO',
|
|
|
|
)
|
|
|
|
|
2017-10-30 06:03:04 -03:00
|
|
|
class rst_zynq(linux):
|
|
|
|
toolchain = 'arm-linux-gnueabihf'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(rst_zynq, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_RST_ZYNQ',
|
|
|
|
)
|
|
|
|
|
2016-03-03 13:55:05 -04:00
|
|
|
class px4(Board):
|
|
|
|
abstract = True
|
2016-03-15 14:55:30 -03:00
|
|
|
toolchain = 'arm-none-eabi'
|
2016-03-03 13:55:05 -04:00
|
|
|
|
|
|
|
def __init__(self):
|
2017-03-20 15:10:42 -03:00
|
|
|
# bootloader name: a file with that name will be used and installed
|
|
|
|
# on ROMFS
|
2017-04-02 11:56:50 -03:00
|
|
|
super(px4, self).__init__()
|
|
|
|
|
2017-01-26 18:25:49 -04:00
|
|
|
self.bootloader_name = None
|
2017-03-20 15:10:42 -03:00
|
|
|
|
|
|
|
# board name: it's the name of this board that's also used as path
|
|
|
|
# in ROMFS: don't add spaces
|
2017-01-26 19:06:47 -04:00
|
|
|
self.board_name = None
|
2017-03-20 15:10:42 -03:00
|
|
|
|
|
|
|
# px4io binary name: this is the name of the IO binary to be installed
|
|
|
|
# in ROMFS
|
2017-01-26 19:49:39 -04:00
|
|
|
self.px4io_name = None
|
2017-03-20 15:10:42 -03:00
|
|
|
|
|
|
|
# board-specific init script: if True a file with `board_name` name will
|
|
|
|
# be searched for in sources and installed in ROMFS as rc.board. This
|
|
|
|
# init script is used to change the init behavior among different boards.
|
2017-02-22 18:55:09 -04:00
|
|
|
self.board_rc = False
|
2017-06-05 18:19:37 -03:00
|
|
|
|
|
|
|
# Path relative to the ROMFS directory where to find a file with default
|
|
|
|
# parameters. If set this file will be copied to /etc/defaults.parm
|
|
|
|
# inside the ROMFS
|
|
|
|
self.param_defaults = None
|
|
|
|
|
2016-12-10 05:22:03 -04:00
|
|
|
self.ROMFS_EXCLUDE = []
|
2016-03-03 13:55:05 -04:00
|
|
|
|
2018-06-28 07:10:15 -03:00
|
|
|
# use ardupilot version of px_uploader.py
|
|
|
|
os.environ['UPLOADER'] = os.path.realpath(os.path.join(os.path.dirname(__file__), 'px_uploader.py'))
|
|
|
|
|
2016-03-03 13:55:05 -04:00
|
|
|
def configure(self, cfg):
|
2017-01-26 18:25:49 -04:00
|
|
|
if not self.bootloader_name:
|
|
|
|
cfg.fatal('configure: px4: bootloader name is required')
|
2017-01-26 19:06:47 -04:00
|
|
|
if not self.board_name:
|
|
|
|
cfg.fatal('configure: px4: board name is required')
|
2016-03-03 13:55:05 -04:00
|
|
|
|
|
|
|
super(px4, self).configure(cfg)
|
|
|
|
cfg.load('px4')
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(px4, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD = 'HAL_BOARD_PX4',
|
2016-10-31 08:04:02 -03:00
|
|
|
HAVE_OCLOEXEC = 0,
|
2016-03-03 13:55:05 -04:00
|
|
|
HAVE_STD_NULLPTR_T = 0,
|
|
|
|
)
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-Wlogical-op',
|
|
|
|
'-Wframe-larger-than=1300',
|
|
|
|
'-fsingle-precision-constant',
|
2017-08-16 23:37:01 -03:00
|
|
|
'-Wno-attributes',
|
2016-03-03 13:55:05 -04:00
|
|
|
'-Wno-error=double-promotion',
|
|
|
|
'-Wno-error=missing-declarations',
|
|
|
|
'-Wno-error=float-equal',
|
|
|
|
'-Wno-error=undef',
|
|
|
|
'-Wno-error=cpp',
|
|
|
|
]
|
|
|
|
env.AP_LIBRARIES += [
|
|
|
|
'AP_HAL_PX4',
|
|
|
|
]
|
|
|
|
env.GIT_SUBMODULES += [
|
|
|
|
'PX4Firmware',
|
|
|
|
'PX4NuttX',
|
|
|
|
'uavcan',
|
|
|
|
]
|
2017-04-02 11:56:50 -03:00
|
|
|
|
2018-03-02 22:14:09 -04:00
|
|
|
if sys.platform == 'cygwin':
|
|
|
|
env.CXXFLAGS += ['-DCYGWIN_BUILD']
|
|
|
|
|
2016-12-10 05:22:03 -04:00
|
|
|
env.ROMFS_EXCLUDE = self.ROMFS_EXCLUDE
|
2016-03-03 13:55:05 -04:00
|
|
|
|
2017-01-26 18:25:49 -04:00
|
|
|
env.PX4_BOOTLOADER_NAME = self.bootloader_name
|
2017-01-26 19:06:47 -04:00
|
|
|
env.PX4_BOARD_NAME = self.board_name
|
2017-02-22 18:55:09 -04:00
|
|
|
env.PX4_BOARD_RC = self.board_rc
|
2017-01-26 19:49:39 -04:00
|
|
|
env.PX4_PX4IO_NAME = self.px4io_name
|
2017-06-05 18:19:37 -03:00
|
|
|
env.PX4_PARAM_DEFAULTS = self.param_defaults
|
2018-02-08 02:52:34 -04:00
|
|
|
env.PX4_RC_S_SCRIPT = 'init.d/rcS'
|
2016-03-03 13:55:05 -04:00
|
|
|
|
|
|
|
env.AP_PROGRAM_AS_STLIB = True
|
|
|
|
|
|
|
|
def build(self, bld):
|
|
|
|
super(px4, self).build(bld)
|
2016-05-05 19:16:23 -03:00
|
|
|
bld.ap_version_append_str('NUTTX_GIT_VERSION', bld.git_submodule_head_hash('PX4NuttX', short=True))
|
|
|
|
bld.ap_version_append_str('PX4_GIT_VERSION', bld.git_submodule_head_hash('PX4Firmware', short=True))
|
2016-03-03 13:55:05 -04:00
|
|
|
bld.load('px4')
|
|
|
|
|
2016-12-10 05:22:03 -04:00
|
|
|
def romfs_exclude(self, exclude):
|
|
|
|
self.ROMFS_EXCLUDE += exclude
|
|
|
|
|
2016-03-03 13:55:05 -04:00
|
|
|
class px4_v1(px4):
|
|
|
|
name = 'px4-v1'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v1, self).__init__()
|
2017-01-26 18:25:49 -04:00
|
|
|
self.bootloader_name = 'px4fmu_bl.bin'
|
2017-01-26 19:06:47 -04:00
|
|
|
self.board_name = 'px4fmu-v1'
|
2017-01-26 19:49:39 -04:00
|
|
|
self.px4io_name = 'px4io-v1'
|
2016-12-10 05:22:03 -04:00
|
|
|
self.romfs_exclude(['oreoled.bin'])
|
2016-03-03 13:55:05 -04:00
|
|
|
|
|
|
|
class px4_v2(px4):
|
|
|
|
name = 'px4-v2'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v2, self).__init__()
|
2017-01-26 18:25:49 -04:00
|
|
|
self.bootloader_name = 'px4fmuv2_bl.bin'
|
2017-01-26 19:06:47 -04:00
|
|
|
self.board_name = 'px4fmu-v2'
|
2017-01-26 19:49:39 -04:00
|
|
|
self.px4io_name = 'px4io-v2'
|
2016-12-10 05:22:03 -04:00
|
|
|
self.romfs_exclude(['oreoled.bin'])
|
2017-04-02 11:56:50 -03:00
|
|
|
self.with_uavcan = True
|
2016-03-03 13:55:05 -04:00
|
|
|
|
2016-12-09 22:05:08 -04:00
|
|
|
class px4_v3(px4):
|
|
|
|
name = 'px4-v3'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v3, self).__init__()
|
2017-01-26 18:25:49 -04:00
|
|
|
self.bootloader_name = 'px4fmuv2_bl.bin'
|
2017-01-26 19:06:47 -04:00
|
|
|
self.board_name = 'px4fmu-v3'
|
2017-01-26 19:49:39 -04:00
|
|
|
self.px4io_name = 'px4io-v2'
|
2017-04-02 11:56:50 -03:00
|
|
|
self.with_uavcan = True
|
2016-12-09 22:05:08 -04:00
|
|
|
|
2018-02-07 23:25:16 -04:00
|
|
|
class skyviper_v2450_px4(px4_v3):
|
|
|
|
name = 'skyviper-v2450-px4'
|
|
|
|
def __init__(self):
|
|
|
|
super(skyviper_v2450_px4, self).__init__()
|
|
|
|
self.px4io_name = None
|
|
|
|
self.param_defaults = '../../../Tools/Frame_params/SkyViper-2450GPS/defaults.parm'
|
|
|
|
|
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(skyviper_v2450_px4, self).configure_env(cfg, env)
|
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
TOY_MODE_ENABLED = 'ENABLED',
|
|
|
|
USE_FLASH_STORAGE = 1,
|
|
|
|
ARMING_DELAY_SEC = 0,
|
|
|
|
LAND_START_ALT = 700,
|
|
|
|
HAL_RCINPUT_WITH_AP_RADIO = 1,
|
2018-04-23 09:13:38 -03:00
|
|
|
LAND_DETECTOR_ACCEL_MAX = 2,
|
|
|
|
CYRF_SPI_PX4_SPI_BUS = 2,
|
|
|
|
CYRF_SPI_PX4_SPIDEV_EXT = '(spi_dev_e)1',
|
|
|
|
CYRF_IRQ_INPUT = '(GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN15)',
|
2018-02-07 23:25:16 -04:00
|
|
|
)
|
2018-02-08 02:52:34 -04:00
|
|
|
env.PX4_RC_S_SCRIPT = 'init.d/rcS_no_microSD'
|
2018-02-08 03:12:33 -04:00
|
|
|
env.BUILD_ABIN = True
|
2018-02-07 23:25:16 -04:00
|
|
|
|
2016-03-03 13:55:05 -04:00
|
|
|
class px4_v4(px4):
|
|
|
|
name = 'px4-v4'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v4, self).__init__()
|
2017-01-26 18:25:49 -04:00
|
|
|
self.bootloader_name = 'px4fmuv4_bl.bin'
|
2017-01-26 19:06:47 -04:00
|
|
|
self.board_name = 'px4fmu-v4'
|
2017-01-26 19:49:39 -04:00
|
|
|
self.romfs_exclude(['oreoled.bin'])
|
2017-04-02 11:56:50 -03:00
|
|
|
self.with_uavcan = True
|
2017-01-27 05:21:12 -04:00
|
|
|
|
2017-06-20 08:13:22 -03:00
|
|
|
class px4_v4pro(px4):
|
|
|
|
name = 'px4-v4pro'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v4pro, self).__init__()
|
|
|
|
self.bootloader_name = 'px4fmuv4pro_bl.bin'
|
|
|
|
self.board_name = 'px4fmu-v4pro'
|
|
|
|
self.px4io_name = 'px4io-v2'
|
|
|
|
self.romfs_exclude(['oreoled.bin'])
|
|
|
|
self.with_uavcan = True
|
|
|
|
|
2017-01-27 05:21:12 -04:00
|
|
|
class aerofc_v1(px4):
|
|
|
|
name = 'aerofc-v1'
|
|
|
|
def __init__(self):
|
|
|
|
super(aerofc_v1, self).__init__()
|
|
|
|
self.bootloader_name = 'aerofcv1_bl.bin'
|
|
|
|
self.board_name = 'aerofc-v1'
|
|
|
|
self.romfs_exclude(['oreoled.bin'])
|
2017-02-22 19:23:58 -04:00
|
|
|
self.board_rc = True
|
2017-06-05 18:20:15 -03:00
|
|
|
self.param_defaults = '../../../Tools/Frame_params/intel-aero-rtf.param'
|