diff options
author | Jean Cyr <jcyr@dillobits.com> | 2014-04-28 00:52:19 -0400 |
---|---|---|
committer | Jean Cyr <jcyr@dillobits.com> | 2014-04-28 00:52:19 -0400 |
commit | ab257ebcced2af6ddb528a9d48355dc2cac7d10a (patch) | |
tree | 550b07e41052cccced28aafa439bcda264fa952b /src/modules/dataman/dataman.h | |
parent | ad77ba26427aa9a2d8b8241fc95271667a1c0863 (diff) | |
download | px4-firmware-ab257ebcced2af6ddb528a9d48355dc2cac7d10a.tar.gz px4-firmware-ab257ebcced2af6ddb528a9d48355dc2cac7d10a.tar.bz2 px4-firmware-ab257ebcced2af6ddb528a9d48355dc2cac7d10a.zip |
Proper data manager restart handling
Introduce SYS_RESTART_TYPE parameter having one of 3 values: boot
restart, inflight restart, or unknown restart, and defaulting to unknown
restart.
px4io.cpp sets this parameter according to the type of restart detected.
dataman.c retrieves this parameter and clears data entries according to
their persistence level. Does nothing if unknown restart.
Diffstat (limited to 'src/modules/dataman/dataman.h')
-rw-r--r-- | src/modules/dataman/dataman.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/dataman/dataman.h b/src/modules/dataman/dataman.h index 33c9fcd15..4382baeb5 100644 --- a/src/modules/dataman/dataman.h +++ b/src/modules/dataman/dataman.h @@ -75,7 +75,8 @@ extern "C" { /* The reason for the last reset */ typedef enum { DM_INIT_REASON_POWER_ON = 0, /* Data survives resets */ - DM_INIT_REASON_IN_FLIGHT /* Data survives in-flight resets only */ + DM_INIT_REASON_IN_FLIGHT, /* Data survives in-flight resets only */ + DM_INIT_REASON_VOLATILE /* Data does not survive reset */ } dm_reset_reason; /* Maximum size in bytes of a single item instance */ @@ -100,7 +101,7 @@ extern "C" { size_t buflen /* Length in bytes of data to retrieve */ ); - /* Retrieve from the data manager store */ + /* Erase all items of this type */ __EXPORT int dm_clear( dm_item_t item /* The item type to clear */ |