aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBan Siesta <bansiesta@gmail.com>2015-01-04 14:06:52 +0000
committerBan Siesta <bansiesta@gmail.com>2015-01-04 14:06:52 +0000
commit7ce0a56d75f210a947db13b61c1a3c447244850e (patch)
treeae7d3fd0ba85fab7c1ebee3cf0a381959aa6f170
parent04c273bca6c99f31fd04741234d9c8efa849b553 (diff)
downloadpx4-firmware-7ce0a56d75f210a947db13b61c1a3c447244850e.tar.gz
px4-firmware-7ce0a56d75f210a947db13b61c1a3c447244850e.tar.bz2
px4-firmware-7ce0a56d75f210a947db13b61c1a3c447244850e.zip
sdlog2: some comments
-rw-r--r--src/modules/sdlog2/sdlog2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c
index 8537d03b3..16ca72891 100644
--- a/src/modules/sdlog2/sdlog2.c
+++ b/src/modules/sdlog2/sdlog2.c
@@ -1864,12 +1864,14 @@ int check_free_space()
if (statfs_buf.f_bavail < (int)(4*1024*1024/statfs_buf.f_bsize)) {
warnx("no more space on MicroSD (less than 4 MiB)");
mavlink_log_critical(mavlink_fd, "[sdlog2] no more space left on MicroSD");
+ /* we do not need a flag to remember that we sent this warning because we will exit anyway */
return ERROR;
/* use a threshold of 100 MiB to send a warning */
} else if (!space_warning_sent && statfs_buf.f_bavail < (int)(100*1024*1024/statfs_buf.f_bsize)) {
warnx("space on MicroSD running out (less than 100MiB)");
mavlink_log_critical(mavlink_fd, "[sdlog2] space on MicroSD running out");
+ /* we don't want to flood the user with warnings */
space_warning_sent = true;
}