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
|
2015-11-26 10:34:24 -04:00
|
|
|
import sys
|
|
|
|
|
|
|
|
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 = {}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
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-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 = {}
|
|
|
|
|
2016-03-30 15:31:57 -03:00
|
|
|
env.prepend_value('INCLUDES', [
|
|
|
|
cfg.srcnode.find_dir('libraries/AP_Common/missing').abspath()
|
|
|
|
])
|
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
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',
|
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',
|
|
|
|
'-Wfatal-errors',
|
|
|
|
]
|
|
|
|
|
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',
|
|
|
|
]
|
|
|
|
|
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
|
|
|
|
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))
|
2016-02-24 15:18:00 -04:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
Board = BoardMeta('Board', Board.__bases__, dict(Board.__dict__))
|
2015-11-26 10:34:24 -04:00
|
|
|
|
2015-11-26 12:32:27 -04:00
|
|
|
def get_boards_names():
|
2016-02-15 17:26:14 -04:00
|
|
|
return sorted(list(_board_classes.keys()))
|
|
|
|
|
2016-03-07 18:05:46 -04:00
|
|
|
_board = None
|
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',
|
|
|
|
]
|
|
|
|
|
2016-04-19 01:12:42 -03:00
|
|
|
if sys.platform == 'cygwin':
|
|
|
|
env.LIB += [
|
|
|
|
'winmm',
|
|
|
|
]
|
|
|
|
|
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',]
|
|
|
|
env.AP_LIBRARIES = [
|
|
|
|
'AP_HAL_Linux',
|
|
|
|
]
|
|
|
|
|
2016-06-25 12:40:08 -03:00
|
|
|
|
2016-02-15 17:26:14 -04:00
|
|
|
class minlure(linux):
|
2016-02-22 14:26:02 -04:00
|
|
|
def configure_env(self, cfg, env):
|
|
|
|
super(minlure, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_MINLURE',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
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-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',
|
|
|
|
)
|
|
|
|
|
|
|
|
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',
|
|
|
|
)
|
|
|
|
|
|
|
|
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 raspilot(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(raspilot, self).configure_env(cfg, env)
|
2016-02-15 17:26:14 -04:00
|
|
|
|
|
|
|
env.DEFINES.update(
|
|
|
|
CONFIG_HAL_BOARD_SUBTYPE = 'HAL_BOARD_SUBTYPE_LINUX_RASPILOT',
|
|
|
|
)
|
|
|
|
|
|
|
|
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',
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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):
|
|
|
|
self.version = None
|
|
|
|
self.use_px4io = True
|
|
|
|
|
|
|
|
def configure(self, cfg):
|
|
|
|
if not self.version:
|
|
|
|
cfg.fatal('configure: px4: version required')
|
|
|
|
|
|
|
|
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',
|
|
|
|
HAVE_STD_NULLPTR_T = 0,
|
|
|
|
)
|
|
|
|
env.CXXFLAGS += [
|
|
|
|
'-Wlogical-op',
|
|
|
|
'-Wframe-larger-than=1300',
|
|
|
|
'-fsingle-precision-constant',
|
|
|
|
'-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',
|
|
|
|
]
|
|
|
|
|
|
|
|
env.PX4_VERSION = self.version
|
|
|
|
env.PX4_USE_PX4IO = True if self.use_px4io else False
|
|
|
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
class px4_v1(px4):
|
|
|
|
name = 'px4-v1'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v1, self).__init__()
|
|
|
|
self.version = '1'
|
|
|
|
|
|
|
|
class px4_v2(px4):
|
|
|
|
name = 'px4-v2'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v2, self).__init__()
|
|
|
|
self.version = '2'
|
|
|
|
|
|
|
|
class px4_v4(px4):
|
|
|
|
name = 'px4-v4'
|
|
|
|
def __init__(self):
|
|
|
|
super(px4_v4, self).__init__()
|
|
|
|
self.version = '4'
|
|
|
|
self.use_px4io = False
|