parameters: open export files O_TRUNC to discard previous data

- rcS parameter backup try to directly restore param (FRAM) from backup (in case SD card is removed before successful export)
 - rcS parameter backup logging rearrange to capture more logging output (param_import_fail.txt)
 - posix rcS try to keep param backup and restore roughly in sync with NuttX rcS
 - tinybson fix debug printf format
 - param_export_internal ensure file descriptor positioned at 0 (precaution)
This commit is contained in:
Daniel Agar
2022-09-09 16:20:16 -04:00
parent 296b1704c5
commit 3f3a5f19f0
6 changed files with 69 additions and 28 deletions
@@ -7,7 +7,7 @@ param set-default IMU_INTEG_RATE 250
if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0" ]; then
if ! simulator_sih start; then
echo "ERROR [init] simulator_sih failed to start"
echo "ERROR [init] simulator_sih failed to start"
exit 1
fi
@@ -46,7 +46,7 @@ elif [ "$PX4_SIMULATOR" = "ignition" ]; then
sensor_gps_sim start
sensor_mag_sim start
else
echo "ERROR [init] ign gazebo failed to start"
echo "ERROR [init] ign gazebo failed to start"
exit 1
fi
else
@@ -61,7 +61,7 @@ elif [ "$PX4_SIMULATOR" = "ignition" ]; then
sensor_gps_sim start
sensor_mag_sim start
else
echo "ERROR [init] ign gazebo failed to start"
echo "ERROR [init] ign gazebo failed to start"
exit 1
fi