Browse Source

Tools: allow for selection of Storage backend type at runtime

gps-1.3.1
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
b2a7841672
  1. 3
      Tools/ardupilotwaf/boards.py
  2. 25
      Tools/autotest/rover.py
  3. 6
      Tools/autotest/sim_vehicle.py
  4. 2
      Tools/completion/zsh/_waf

3
Tools/ardupilotwaf/boards.py

@ -592,9 +592,6 @@ class sitl(Board): @@ -592,9 +592,6 @@ class sitl(Board):
cfg.fatal("Failed to find SFML Audio libraries")
env.CXXFLAGS += ['-DWITH_SITL_TONEALARM']
if cfg.options.sitl_flash_storage:
env.CXXFLAGS += ['-DSTORAGE_USE_FLASH=1']
if cfg.env.DEST_OS == 'cygwin':
env.LIB += [
'winmm',

25
Tools/autotest/rover.py

@ -5677,6 +5677,27 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) @@ -5677,6 +5677,27 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
target_compid=target_compid,
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):
'''return list of all tests'''
ret = super(AutoTestRover, self).tests()
@ -5899,6 +5920,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm) @@ -5899,6 +5920,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
"Test end mission behavior",
self.test_end_mission_behavior),
("FlashStorage",
"Test flash storage (for parameters etc)",
self.FlashStorage),
("LogUpload",
"Upload logs",
self.log_upload),

6
Tools/autotest/sim_vehicle.py

@ -320,9 +320,6 @@ def do_build(opts, frame_options): @@ -320,9 +320,6 @@ def do_build(opts, frame_options):
if opts.tonealarm:
cmd_configure.append("--enable-sfml-audio")
if opts.flash_storage:
cmd_configure.append("--sitl-flash-storage")
if opts.math_check_indexes:
cmd_configure.append("--enable-math-check-indexes")
@ -671,6 +668,9 @@ def start_vehicle(binary, opts, stuff, spawns=None): @@ -671,6 +668,9 @@ def start_vehicle(binary, opts, stuff, spawns=None):
sys.exit(1)
path = ",".join(paths)
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:
for file in opts.add_param_file:
if not os.path.isfile(file):

2
Tools/completion/zsh/_waf vendored

@ -33,7 +33,7 @@ _waf() { @@ -33,7 +33,7 @@ _waf() {
'--sitl-osd[Enable SITL OSD]' \
'--sitl-rgbled[Enable SITL RGBLed]' \
'--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]' \
'--board[Board name]:board:_waf_boards' \
'--target=[Target name]:target:_waf_targets' \

Loading…
Cancel
Save