dataman: remove obsolete persistence and reset reason

This commit is contained in:
Daniel Agar
2021-12-12 12:06:35 -05:00
committed by GitHub
parent ad1bfb5410
commit 986cf288da
10 changed files with 61 additions and 287 deletions
+3 -5
View File
@@ -537,8 +537,7 @@ Geofence::loadFromFile(const char *filename)
}
}
if (dm_write(DM_KEY_FENCE_POINTS, pointCounter + 1, DM_PERSIST_POWER_ON_RESET, &vertex,
sizeof(vertex)) != sizeof(vertex)) {
if (dm_write(DM_KEY_FENCE_POINTS, pointCounter + 1, &vertex, sizeof(vertex)) != sizeof(vertex)) {
goto error;
}
@@ -571,14 +570,13 @@ Geofence::loadFromFile(const char *filename)
if (dm_read(DM_KEY_FENCE_POINTS, seq, &mission_fence_point, sizeof(mission_fence_point_s)) ==
sizeof(mission_fence_point_s)) {
mission_fence_point.vertex_count = pointCounter;
dm_write(DM_KEY_FENCE_POINTS, seq, DM_PERSIST_POWER_ON_RESET, &mission_fence_point,
sizeof(mission_fence_point_s));
dm_write(DM_KEY_FENCE_POINTS, seq, &mission_fence_point, sizeof(mission_fence_point_s));
}
}
mission_stats_entry_s stats;
stats.num_items = pointCounter;
rc = dm_write(DM_KEY_FENCE_POINTS, 0, DM_PERSIST_POWER_ON_RESET, &stats, sizeof(mission_stats_entry_s));
rc = dm_write(DM_KEY_FENCE_POINTS, 0, &stats, sizeof(mission_stats_entry_s));
} else {
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "Geofence: import error\t");