Commit Graph

80 Commits

Author SHA1 Message Date
Julian Oes 881a2a5860 param_shmem: make all params used
This is a workaround for the fact that the used information is not
shared between the ADSP and the Linux side on the Snapdragon. By
flagging all params used, we can at least receive them on QGC.
2016-03-10 22:26:31 +01:00
jwilson 75fad09263 Fixed problem causing a failure to obtain the shared memory lock on the AppsProc. 2016-02-19 16:59:49 +01:00
jwilson 4adfea7fa9 Resolved shared memory parameter problems and removed additional debug code. 2016-02-19 16:59:49 +01:00
Julian Oes 4b2be9c9d4 param_shmem: remove debug noise 2016-02-19 16:59:46 +01:00
Mark Charlebois 791ec37f43 Code formatter fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:46 +01:00
Mark Charlebois caa94d58a6 Manually integrated Jim's changes from integrate2_jim branch
Signed-off-by: Jim Wilson <jywilson99@hotmail.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:46 +01:00
Mark Charlebois dab1f835c7 Code cleanup and ifdefs required for qurt build
Code that was previously out of tree that was #if 0, is now #ifdef __PX4_QURT.
These changes were required for flight using the qurt build.

Changes include code cleanup for shmem_posix.c.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:45 +01:00
Mark Charlebois 8b22bde071 Code format fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:45 +01:00
Mark Charlebois 014f15d8b0 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:43 +01:00
Mark Charlebois fea910d45a Code cleanup and ifdefs required for qurt build
Code that was previously out of tree that was #if 0, is now #ifdef __PX4_QURT.
These changes were required for flight using the qurt build.

Changes include code cleanup for shmem_posix.c.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:43 +01:00
Mark Charlebois 5846a22a8f Code format fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:42 +01:00
Mark Charlebois 9f3bf8e9f4 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:41 +01:00
Nate Weibley 0419a99f00 New param hashing spec
- When listing all params, lead with _HASH_CHECK value for cache load
 - When set value on _HASH_CHECK is rx'd, stop any ongoing listing req
2016-02-18 18:51:17 +01:00
Lorenz Meier f52ce2001d Param lib: fix code style 2016-01-23 14:29:15 +01:00
Lorenz Meier 4b893053a0 param: Lock read operation 2016-01-23 13:32:52 +01:00
Lorenz Meier c18d31ce41 Param write: Support locking the bus 2016-01-23 13:23:53 +01:00
Lorenz Meier f460e95554 Param: Increase robustness of default save command 2016-01-22 14:21:09 +01:00
Lorenz Meier 3a43038583 Params: Provide set and save API 2016-01-22 11:35:56 +01:00
Nate Weibley 8a4699c656 Fix style 2015-10-12 15:26:11 -04:00
Nate Weibley d7274ac5f0 Enable hash check of used parameters to verify integrity of GCS local copy 2015-10-12 13:40:14 -04:00
Daniel Agar 2529f07d44 restore format check 2015-10-06 18:28:30 -04:00
Lorenz Meier b3a8ba4e92 param: Move to POSIX semaphore abstraction 2015-09-20 00:29:22 +02:00
Mark Charlebois fc3acdb2c1 cmake: param refactoring
Use a struct to contain all the parameters so the ordering in
memory is not machine dependent.

Add number of parameters to the param struct. The struct actually
allows direct accessing by the member name if desired.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-11 12:41:00 -07:00
Mark Charlebois b9ef1ee6ed param: Build param without linker script
Changed to enable the posix_sitl_simple target to build and run

param show *

without using a linker script

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-11 02:33:42 -07:00
Lorenz Meier fba569f12c Fix code style for system lib 2015-09-06 11:59:50 +02:00
Lorenz Meier 3bad91dd3b systemlib: Fix param access for used params 2015-06-25 09:28:04 +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
Mark Charlebois 7c00bf11fd remove long long from union param_value_u
The long long was mistakenly added when debugging an alignment issue
on x86_64.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-03 21:00:40 -07:00
Lorenz Meier 3dbd48fbad param style fix 2015-06-03 22:51:02 +02:00
David Sidrane 03bdf1e5f2 Allow allocation of changed paramaters to fail, then all param functions will return PARAM_INVALID or a count of 0 2015-06-03 22:49:57 +02:00
David Sidrane 7950167bc5 Added assertion on allocation failure for parameter change storage, removed magic numbers 2015-06-03 22:49:57 +02:00
Mark Charlebois 1ca05aaa64 orb_advert_t changed to void * and checks changed to nullptr
The existing orb_advert_t use thoughout the code sometimes tries
to treat it as a file descriptor and there are checks for < 0
and ::close calls on orb_advert_t types which is an invalid use
of an object pointer, which is what orb_advert_t really is.

Initially I had changed the -1 initializations to 0 but it was
suggested that this should be nullptr. That was a good recommendation
but the definition of orb_advert_t had to change to void * because
you cannot initialize a uintptr_t as nullptr.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:42:49 -07:00
Mark Charlebois a734fc96d1 extensive orb_advert_t fixes
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.

The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.

Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:41:33 -07:00
Mark Charlebois 7301b59d14 Unit tests: Fixed unit test build
Unit tests now work. The linux build was failing saving params
because it was using the changes for QuRT that fake out the
filesystem.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 13:36:13 -07:00
Lorenz Meier e5fad077df Merge master into linux 2015-05-18 23:28:57 +02:00
Lorenz Meier c06ba047e2 param lib: Fix index used routine 2015-05-18 23:15:20 +02:00
Lorenz Meier 635b7fa01d param API: Ensure info count method is called 2015-05-18 00:17:09 +02:00
Lorenz Meier 2f5e27c180 param lib: Fix code style 2015-05-17 23:08:10 +02:00
Lorenz Meier ff4be81976 Param: do not set a param as used just because its value is non-default. 2015-05-17 23:05:32 +02:00
Lorenz Meier e279e8bb2a Fix param changed count logic, speed up logic for unused params 2015-05-17 22:58:52 +02:00
David Sidrane c6bc3153ef Reviewd - fixed indexing that was wrong, code clean up ran astyle 2015-05-15 03:58:04 -10:00
Lorenz Meier 535eb7dbd9 param lib: Fix use of array size 2015-05-15 09:11:28 +02:00
David Sidrane a0af91d05c Missing Brace 2015-05-14 18:15:10 -10:00
David Sidrane 6667e6e078 Update param.c
Not used px4_macros.h anyway
2015-05-14 18:03:23 -10:00
David Sidrane 8e9fdc6147 Use stdlib's calloc for compaiblity 2015-05-14 17:03:10 -10:00
David Sidrane dc4d5619ea Reduced the amount of memory used by params to only that that is needed
Conflicts:
	src/modules/systemlib/param/param.c
2015-05-14 17:02:45 -10:00
Mark Charlebois 6db77dc8bb Experimental virtual file support
QuRT does not have a filesystem, so creating a virtual filesystem
that could be implemented as an in-memory file or a remote file
over fastRPC.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 22:12:45 -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 ed12d9c733 systemlib: Fix param used counting 2015-04-27 09:03:35 +02:00