2019-05-26 22:46:41 -03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
2019-10-02 06:04:44 -03:00
|
|
|
import fnmatch
|
2021-10-17 17:29:17 -03:00
|
|
|
import sys
|
|
|
|
|
|
|
|
try:
|
|
|
|
import em
|
|
|
|
except ImportError:
|
2023-12-02 20:47:37 -04:00
|
|
|
print("you need to install empy with 'python -m pip install empy==3.3.4'")
|
2021-10-17 17:29:17 -03:00
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
try:
|
|
|
|
import pexpect
|
|
|
|
except ImportError:
|
|
|
|
print("you need to install pexpect with 'python -m pip install pexpect'")
|
|
|
|
sys.exit(1)
|
|
|
|
|
2019-10-02 06:04:44 -03:00
|
|
|
|
2019-05-26 22:46:41 -03:00
|
|
|
def build(bld):
|
2021-01-05 17:43:49 -04:00
|
|
|
targets = bld.ap_periph_boards()
|
2019-10-02 06:04:44 -03:00
|
|
|
valid_target = False
|
|
|
|
for t in targets:
|
|
|
|
if fnmatch.fnmatch(bld.env.BOARD, t):
|
|
|
|
valid_target = True
|
|
|
|
if not valid_target:
|
2019-05-26 22:46:41 -03:00
|
|
|
return
|
|
|
|
|
2021-06-20 03:02:12 -03:00
|
|
|
if bld.env.AP_PERIPH_HEAVY:
|
|
|
|
libraries = bld.ap_get_all_libraries()
|
2022-10-06 18:28:57 -03:00
|
|
|
libraries.extend(['AP_ADSB/sagetech-sdk'])
|
2021-06-20 03:02:12 -03:00
|
|
|
bld.env.DEFINES += ['HAL_BOARD_AP_PERIPH_HEAVY']
|
|
|
|
else:
|
|
|
|
libraries = ['AP_Common',
|
|
|
|
'AP_HAL',
|
|
|
|
'AP_HAL_Empty',
|
|
|
|
'AP_Math',
|
|
|
|
'AP_BoardConfig',
|
|
|
|
'AP_BattMonitor',
|
|
|
|
'AP_CANManager',
|
2023-03-16 21:25:56 -03:00
|
|
|
'AP_KDECAN',
|
2021-06-20 03:02:12 -03:00
|
|
|
'AP_Param',
|
|
|
|
'StorageManager',
|
|
|
|
'AP_FlashStorage',
|
|
|
|
'AP_RAMTRON',
|
|
|
|
'AP_GPS',
|
2023-07-06 14:46:05 -03:00
|
|
|
'AP_Networking',
|
2021-06-20 03:02:12 -03:00
|
|
|
'AP_SerialManager',
|
|
|
|
'AP_RTC',
|
|
|
|
'AP_Compass',
|
2023-01-31 19:16:14 -04:00
|
|
|
'AP_NMEA_Output',
|
2021-06-20 03:02:12 -03:00
|
|
|
'AP_Baro',
|
|
|
|
'Filter',
|
|
|
|
'AP_InternalError',
|
|
|
|
'AP_Airspeed',
|
|
|
|
'AP_RangeFinder',
|
|
|
|
'AP_ROMFS',
|
2022-09-02 18:41:38 -03:00
|
|
|
'AP_TemperatureSensor',
|
2021-06-20 03:02:12 -03:00
|
|
|
'AP_MSP',
|
|
|
|
'SRV_Channel',
|
|
|
|
'AP_Notify',
|
|
|
|
'AP_SerialLED',
|
|
|
|
'AP_Filesystem',
|
|
|
|
'AP_InertialSensor',
|
|
|
|
'AP_AccelCal',
|
|
|
|
'AP_Logger',
|
|
|
|
'AC_PID',
|
2021-12-06 22:47:50 -04:00
|
|
|
'AP_BLHeli',
|
|
|
|
'AP_ESC_Telem',
|
2022-06-03 08:00:14 -03:00
|
|
|
'AP_Stats',
|
|
|
|
'AP_EFI',
|
2022-08-11 05:03:47 -03:00
|
|
|
'AP_CheckFirmware',
|
2023-08-02 18:34:40 -03:00
|
|
|
'AP_RPM',
|
2022-09-27 16:45:07 -03:00
|
|
|
'AP_Proximity',
|
2023-05-18 05:20:22 -03:00
|
|
|
'AP_RCProtocol',
|
2023-08-17 17:27:55 -03:00
|
|
|
'AP_AHRS',
|
|
|
|
'AP_Terrain',
|
|
|
|
'AP_Torqeedo',
|
2023-08-19 03:10:38 -03:00
|
|
|
'AP_Volz_Protocol',
|
|
|
|
'AP_SBusOut',
|
|
|
|
'AP_RobotisServo',
|
|
|
|
'AP_FETtecOneWire',
|
2023-09-29 01:13:50 -03:00
|
|
|
'GCS_MAVLink',
|
2024-01-01 17:56:28 -04:00
|
|
|
'AP_Relay'
|
2021-06-20 03:02:12 -03:00
|
|
|
]
|
2023-09-27 20:32:37 -03:00
|
|
|
|
2019-05-26 22:46:41 -03:00
|
|
|
bld.ap_stlib(
|
|
|
|
name= 'AP_Periph_libs',
|
2022-10-24 00:16:08 -03:00
|
|
|
dynamic_source='modules/DroneCAN/libcanard/dsdlc_generated/src/**.c',
|
2019-05-26 22:46:41 -03:00
|
|
|
ap_vehicle='AP_Periph',
|
2021-06-20 03:02:12 -03:00
|
|
|
ap_libraries= libraries,
|
2022-10-23 22:59:44 -03:00
|
|
|
use='dronecan',
|
2019-05-26 22:46:41 -03:00
|
|
|
exclude_src=[
|
|
|
|
'libraries/AP_HAL_ChibiOS/Storage.cpp'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# build external libcanard library
|
2022-10-24 00:16:08 -03:00
|
|
|
bld.stlib(source='../../modules/DroneCAN/libcanard/canard.c',
|
|
|
|
name='libcanard',
|
2022-10-23 22:59:44 -03:00
|
|
|
use='dronecan',
|
2019-05-26 22:46:41 -03:00
|
|
|
target='libcanard')
|
|
|
|
|
|
|
|
bld.ap_program(
|
|
|
|
program_name='AP_Periph',
|
2022-10-23 22:59:44 -03:00
|
|
|
use=['AP_Periph_libs', 'libcanard', 'dronecan'],
|
2019-05-26 22:46:41 -03:00
|
|
|
program_groups=['bin','AP_Periph'],
|
|
|
|
)
|