27 Commits

Author SHA1 Message Date
Lorenz Meier
ff17f31cce Dataman: Optimize for space 2014-10-05 13:09:02 +02:00
Thomas Gubler
8a18cfa386 datman: reduce task priority 2014-09-27 16:26:14 +02:00
Anton Babushkin
29bf1fe6fa dataman: added macro for offboard storage selection 2014-07-07 15:18:12 +02:00
Anton Babushkin
1a6b2b9c1e Merge branch 'master' into dataman_state_nav_rewrite 2014-06-30 12:31:06 +02:00
Don Gagne
92adbe9216 Fix compiler warnings 2014-06-29 17:47:24 -07:00
Anton Babushkin
91b590ef58 Move MISSION_STATE read/write from mavlink to navigator and commander 2014-06-13 23:40:48 +02:00
Anton Babushkin
2951962c21 dataman: rename SYSTEM_STATE section to MISSION_STATE 2014-06-12 13:11:45 +02:00
Anton Babushkin
4ad435b483 dataman: allow writing empty items with nullptr pointer to data 2014-06-09 16:09:03 +02:00
Jean Cyr
a6cf04a6ff Create system state entry in dataman - ATTN Anton
Create persistent system state id for data manager to store system state
that will persist across resets.
2014-06-08 14:08:22 -04:00
Lorenz Meier
4176fc69bb Merge branch 'master' of github.com:PX4/Firmware into stack_sweep 2014-05-15 08:43:09 +02:00
Lorenz Meier
839373f5ae Merge pull request #938 from jean-m-cyr/master
Reduce potential dataman memory fragmentation
2014-05-14 23:42:52 -07:00
Lorenz Meier
93388803b7 Merge branch 'master' of github.com:PX4/Firmware into stack_sweep 2014-05-15 07:17:38 +02:00
Lorenz Meier
19dc0b9509 dataman: Fix doxygen, no functional changes 2014-05-15 07:15:41 +02:00
Lorenz Meier
25fd20487e reduce stack size of dataman start handler 2014-05-14 19:35:16 +02:00
Jean Cyr
cd9a72e391 Free data manager work items the same way they were allocated
Since data manager work items are allocated in groups of 8, they need to
be freed the same way should the manager need to stop.
2014-05-13 20:24:19 -04:00
Jean Cyr
8d3fed0944 Reduce potential dataman memory fragmentation
The data manager dynamically allocates relatively small work item blocks
on an as needed basis. It never frees these, instead maintaining then in
a list of available block for reuse when needed. Even if these blocks
are small, the are required at non-deterministic times and can end up
scattered in memory thus causing memory fragmentation. In order to
mitigate this problems work item blocks are allocated in groups of 8 in
contiguous memory to reduce the number of scattered memory allocations.
In reality, based on current usage, rarely will more than one group of 8
be allocated.
2014-05-13 19:59:44 -04:00
Jean Cyr
ab257ebcce 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.
2014-04-28 00:52:19 -04:00
Jean Cyr
bf4558c31b Reduce data manager SD card wear and tear
When the data manager was first designed each file record contained a 2
byte header and an 126 byte data section, resulting in a record length
of 128 bytes. Along the way it was decided to add 2 spare bytes to the
record header, but regrettably the data section was not correspondingly
reduced in size so we end up with a record length of 130 bytes. This is
bad since it does not align with SD card flash sectors and results in
more erase/write flash cycles than necessary thus reducing the SD cards
life.

This update reduced the data section of the data manager to 124,
resulting in an optimal record length of 128 bytes.

In order to avoid the reuse of data previously written data in the old
format, which could result in catastrophic misinterpretation, the data
manager file is checked at startup. If it is found to be in the old
format, it is deleted and recreated with in the new record length. In
this case previously stored data is lost, but that is far safer than the
unpredictable result of using the old file.
2014-04-22 01:19:01 -04:00
Jean Cyr
debb4f7021 Coding style
astyle according to http://pixhawk.org/dev/code_style
2014-03-23 01:35:13 -04:00
Jean Cyr
17c18947a4 Remove uneccesary dependencies and update credits 2014-03-23 01:05:06 -04:00
Jean Cyr
b92b08ae62 Optimize and update data manager docs
Move repeated code to common function
Update missing and misleading comments
Fix data manager test compile errors
No functional changes
2014-02-02 00:42:15 -05:00
Julian Oes
b10fa3d047 Waypoints/Navigator: Use two different dataman storage places, keep old waypoints until all new ones are written 2013-12-25 11:23:58 +01:00
Thomas Gubler
96debedcc8 prevent dataman from blocking startup when no sd card is present 2013-12-24 11:41:04 +01:00
Julian Oes
6a624abd7c Datamanager: Rename mavlink/offboard key 2013-12-16 17:13:17 +01:00
Julian Oes
e8df08f139 Dataman: Also reserve space for onboard missions 2013-12-16 17:12:37 +01:00
Julian Oes
e034f5135e Dataman: Some minor fixes 2013-12-03 16:25:46 +01:00
Jean Cyr
1cf9f72f62 Add data manager module and fence support to navigator
- Add function to geo.c to determine if global position is inside fence
- Add navigator support/commands for maintaining fence coords.
- Add data manager module to support persistence fence storage. Can
store other data, but only used for fence at this time.
- Add unit tests for data manager
2013-11-03 12:40:13 -05:00