Tools: allow for selection of Storage backend type at runtime
This commit is contained in:
parent
3292128531
commit
b2a7841672
@ -592,9 +592,6 @@ class sitl(Board):
|
|||||||
cfg.fatal("Failed to find SFML Audio libraries")
|
cfg.fatal("Failed to find SFML Audio libraries")
|
||||||
env.CXXFLAGS += ['-DWITH_SITL_TONEALARM']
|
env.CXXFLAGS += ['-DWITH_SITL_TONEALARM']
|
||||||
|
|
||||||
if cfg.options.sitl_flash_storage:
|
|
||||||
env.CXXFLAGS += ['-DSTORAGE_USE_FLASH=1']
|
|
||||||
|
|
||||||
if cfg.env.DEST_OS == 'cygwin':
|
if cfg.env.DEST_OS == 'cygwin':
|
||||||
env.LIB += [
|
env.LIB += [
|
||||||
'winmm',
|
'winmm',
|
||||||
|
@ -5677,6 +5677,27 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
|
|||||||
target_compid=target_compid,
|
target_compid=target_compid,
|
||||||
want_result=mavutil.mavlink.MAV_RESULT_FAILED)
|
want_result=mavutil.mavlink.MAV_RESULT_FAILED)
|
||||||
|
|
||||||
|
def FlashStorage(self):
|
||||||
|
self.set_parameter("LOG_BITMASK", 1)
|
||||||
|
self.reboot_sitl()
|
||||||
|
|
||||||
|
self.customise_SITL_commandline([
|
||||||
|
"--set-storage-posix-enabled", "0",
|
||||||
|
"--set-storage-flash-enabled", "1",
|
||||||
|
])
|
||||||
|
if self.get_parameter("LOG_BITMASK") == 1:
|
||||||
|
raise NotAchievedException("not using flash storage?")
|
||||||
|
self.set_parameter("LOG_BITMASK", 2)
|
||||||
|
self.reboot_sitl()
|
||||||
|
self.assert_parameter_value("LOG_BITMASK", 2)
|
||||||
|
self.set_parameter("LOG_BITMASK", 3)
|
||||||
|
self.reboot_sitl()
|
||||||
|
self.assert_parameter_value("LOG_BITMASK", 3)
|
||||||
|
|
||||||
|
self.customise_SITL_commandline([])
|
||||||
|
# make sure we're back at our original value:
|
||||||
|
self.assert_parameter_value("LOG_BITMASK", 1)
|
||||||
|
|
||||||
def tests(self):
|
def tests(self):
|
||||||
'''return list of all tests'''
|
'''return list of all tests'''
|
||||||
ret = super(AutoTestRover, self).tests()
|
ret = super(AutoTestRover, self).tests()
|
||||||
@ -5899,6 +5920,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
|
|||||||
"Test end mission behavior",
|
"Test end mission behavior",
|
||||||
self.test_end_mission_behavior),
|
self.test_end_mission_behavior),
|
||||||
|
|
||||||
|
("FlashStorage",
|
||||||
|
"Test flash storage (for parameters etc)",
|
||||||
|
self.FlashStorage),
|
||||||
|
|
||||||
("LogUpload",
|
("LogUpload",
|
||||||
"Upload logs",
|
"Upload logs",
|
||||||
self.log_upload),
|
self.log_upload),
|
||||||
|
@ -320,9 +320,6 @@ def do_build(opts, frame_options):
|
|||||||
if opts.tonealarm:
|
if opts.tonealarm:
|
||||||
cmd_configure.append("--enable-sfml-audio")
|
cmd_configure.append("--enable-sfml-audio")
|
||||||
|
|
||||||
if opts.flash_storage:
|
|
||||||
cmd_configure.append("--sitl-flash-storage")
|
|
||||||
|
|
||||||
if opts.math_check_indexes:
|
if opts.math_check_indexes:
|
||||||
cmd_configure.append("--enable-math-check-indexes")
|
cmd_configure.append("--enable-math-check-indexes")
|
||||||
|
|
||||||
@ -671,6 +668,9 @@ def start_vehicle(binary, opts, stuff, spawns=None):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
path = ",".join(paths)
|
path = ",".join(paths)
|
||||||
progress("Using defaults from (%s)" % (path,))
|
progress("Using defaults from (%s)" % (path,))
|
||||||
|
if opts.flash_storage:
|
||||||
|
cmd.append("--set-storage-flash-enabled 1")
|
||||||
|
cmd.append("--set-storage-posix-enabled 0")
|
||||||
if opts.add_param_file:
|
if opts.add_param_file:
|
||||||
for file in opts.add_param_file:
|
for file in opts.add_param_file:
|
||||||
if not os.path.isfile(file):
|
if not os.path.isfile(file):
|
||||||
|
@ -33,7 +33,7 @@ _waf() {
|
|||||||
'--sitl-osd[Enable SITL OSD]' \
|
'--sitl-osd[Enable SITL OSD]' \
|
||||||
'--sitl-rgbled[Enable SITL RGBLed]' \
|
'--sitl-rgbled[Enable SITL RGBLed]' \
|
||||||
'--build-dates[Include build date in binaries]' \
|
'--build-dates[Include build date in binaries]' \
|
||||||
'--sitl-flash-storage[Building SITL with flash storage emulation.]' \
|
'--sitl-flash-storage[Use flash storage emulation.]' \
|
||||||
'--upload[Upload applicable targets to a connected device]' \
|
'--upload[Upload applicable targets to a connected device]' \
|
||||||
'--board[Board name]:board:_waf_boards' \
|
'--board[Board name]:board:_waf_boards' \
|
||||||
'--target=[Target name]:target:_waf_targets' \
|
'--target=[Target name]:target:_waf_targets' \
|
||||||
|
Loading…
Reference in New Issue
Block a user