From a1fb9fb7c648364535834f64f6d9febe7e69a265 Mon Sep 17 00:00:00 2001 From: Mark Sauder Date: Mon, 23 May 2022 18:35:22 -0600 Subject: [PATCH] rcS: Keep Mag Cal with AUTOCONFIG param reset in rcS, deprecate rcS AUTOCNF param (#19693) * Deprecate the rcS AUTOCNF script param and associated logic. * Update posix rcS to match previous commit. --- ROMFS/px4fmu_common/init.d-posix/rcS | 13 ++----------- ROMFS/px4fmu_common/init.d/rcS | 17 +++-------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 206d2654d4..882e408250 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -95,10 +95,9 @@ fi if param compare SYS_AUTOCONFIG 1 then + # Reset params except Airframe, RC calibration, sensor calibration, flight modes, total flight time, and next flight UUID. + param reset_all SYS_AUTOSTART RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT* set AUTOCNF yes - - # Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal, next flight UUID - param reset_all SYS_AUTO* RC* COM_FLTMODE* LND_FLIGHT* TC_* CAL_ACC* CAL_GYRO* COM_FLIGHT* fi # multi-instance setup @@ -196,14 +195,6 @@ fi . "$autostart_file" -# -# If autoconfig parameter was set, reset it and save parameters. -# -if [ $AUTOCNF = yes ] -then - param set SYS_AUTOCONFIG 0 -fi - # Simulator IMU data provided at 250 Hz param set IMU_INTEG_RATE 250 diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 187a2ff7f6..c0b9ce7f76 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -21,7 +21,6 @@ set +e # it wastes flash # set R / -set AUTOCNF no set FCONFIG /fs/microsd/etc/config.txt set FEXTRAS /fs/microsd/etc/extras.txt set FRC /fs/microsd/etc/rc.txt @@ -177,13 +176,12 @@ else fi # - # Set AUTOCNF flag to use it in AUTOSTART scripts. + # If the airframe has been previously reset SYS_AUTCONFIG will have been set to 1 and other params will be reset on the next boot. # if param greater SYS_AUTOCONFIG 0 then - # Wipe out params except RC*, flight modes, total flight time, calibration parameters, next flight UUID - param reset_all SYS_AUTO* RC* COM_FLTMODE* LND_FLIGHT* TC_* CAL_ACC* CAL_GYRO* COM_FLIGHT* - set AUTOCNF yes + # Reset params except Airframe, RC calibration, sensor calibration, flight modes, total flight time, and next flight UUID. + param reset_all SYS_AUTOSTART RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT* fi # @@ -274,14 +272,6 @@ else . $FCONFIG fi - # - # If autoconfig parameter was set, reset it and save parameters. - # - if [ $AUTOCNF = yes ] - then - param set SYS_AUTOCONFIG 0 - fi - # # Check if UAVCAN is enabled, default to it for ESCs. # @@ -565,7 +555,6 @@ fi # Unset all script parameters to free RAM. # unset R -unset AUTOCNF unset FCONFIG unset FEXTRAS unset FRC