59 Commits

Author SHA1 Message Date
Julian Oes
a39124a10d dataman: make it less chatty
- Removed a couple of unneeded printfs.
- On POSIX it shouldn't warn if it's not a multiple of the
  block size.
2016-06-07 22:10:56 +02:00
Julian Oes
3a8d242576 dataman: get path for Snapdragon right 2016-05-14 11:21:44 +02:00
James Goppert
967e4dd127 Modified cmake to use STACK_MAX and STACK_MAIN 2016-04-14 13:36:36 -04:00
Lorenz Meier
6e8f563d27 dataman: Do not reset mission file on each reboot 2016-02-11 18:40:18 +01:00
Lorenz Meier
b6c4501d0e Adjust data size of dataman to force reset of all existing user data 2015-12-02 09:15:37 +01:00
Lorenz Meier
a0bfd3a5bf Dataman: Remove excessive stack allocation 2015-10-10 22:23:34 +02:00
Lorenz Meier
228cc8844e Dataman: Lower scheduling priority 2015-10-10 16:02:29 +02:00
Lorenz Meier
73fabc2b4d dataman: Limit variable scope 2015-10-07 16:30:24 +02:00
Lorenz Meier
fa5071b3c5 Remove module.mk files to prevent confusion of adopters upgrading 2015-10-06 11:23:20 +02:00
Lorenz Meier
fa27e59ac4 dataman: Move to semaphore abstraction 2015-09-20 00:28:39 +02:00
James Goppert
1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Lorenz Meier
d18d43b0da dataman: fix code style 2015-09-05 22:16:38 +02:00
Lorenz Meier
cb7a4f5799 dataman: Adjust to uORB mission changes 2015-08-20 11:07:53 +02:00
Lorenz Meier
10a77a1513 Dataman: Be more verbose on error 2015-07-05 13:46:24 +02:00
Lorenz Meier
454becdae5 Merged release_v1.0.0 branch into master 2015-06-25 21:45:17 +02:00
Lorenz Meier
1c82f73822 Dataman: Reduce excessive stack allocation 2015-06-22 22:15:45 +02:00
Mark Charlebois
872a26e6da Fixed passed ot open() for O_CREAT
In nuttx the mode parameter to open is not required but in Linux,
and per the POSIX spec, mode is required if the O_CREAT flag is
passed.

The mode flags are different for NuttX and Linux so a new set of
PX4 defines was added:

PX4_O_MODE_777 - read, write, execute for user, group and other
PX4_O_MODE_666 - read, and write for user, group and other
PX4_O_MODE_600 - read, and write for user

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-14 11:26:40 +02:00
Mark Charlebois
4d1ae6269b POSIX: Added PX4_ROOTFSDIR to file paths
Set a default path relative to current dir for the posix target.

Running make posixrun will create the required directoroes and then run
mainapp from its build location.

PX4_ROOTFSDIR is set to nothing for nuttx.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-11 21:36:13 -07:00
Lorenz Meier
f5ce8e4826 Update dataman to reflect topic updates 2015-05-27 15:21:31 -07:00
Lorenz Meier
68d723e26c dataman: add missing include of px4_defines header 2015-05-27 21:10:48 +02:00
Lorenz Meier
4565f57468 Merged release_v1.0.0 into master 2015-05-27 15:28:41 -07:00
Mark Charlebois
cb5db8ec83 dataman: Fixed file permissions on file creation
In Linux the file was being created with incorrect permissions.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-21 10:37:15 -07:00
Mark Charlebois
05720b5aef Added ability to set OS specific path for dataman file
dataman can now be started using:

dataman start -f filepath

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-21 09:24:48 -07:00
Mark Charlebois
eed2479dfc Added px4_ prefix to task_spawn_cmd
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 14:20:08 -07:00
Mark Charlebois
190814bc97 Merge remote-tracking branch 'upstream/master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	src/drivers/rgbled/rgbled.cpp
	src/modules/commander/PreflightCheck.cpp
	src/modules/commander/airspeed_calibration.cpp
	src/modules/commander/calibration_routines.cpp
	src/modules/commander/gyro_calibration.cpp
	src/modules/commander/mag_calibration.cpp
	src/modules/mc_att_control/mc_att_control_main.cpp
2015-04-28 11:48:26 -07:00
Lorenz Meier
16b033982c Dataman: Be more compact in boot output 2015-04-27 09:07:53 +02:00
Mark Charlebois
192d70e570 Linux: removed separate path for dataman file for Linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois
2abfb7a5be Linux: added queue files for dataman support
The dataman module now works under linux using /tmp/dataman as the
file path. Two files from NuttX were added to the Linux impl for
single linked queue handling.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois
fd7863270e Nuttx: fixed missing changes from AppMgr to AppState
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois
9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Lorenz Meier
21b88cd874 dataman: Reduce stack to 1800, based on real usage of 800 bytes 2015-01-21 09:24:31 +01:00
Lorenz Meier
138c25ec74 dataman: less verbose, fix code style 2014-11-22 16:34:47 +01:00
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