101 Commits

Author SHA1 Message Date
Julian Oes
623b99327d param: lock the bus as short as possible (#5187)
Since the FRAM and the baro are on the same bus on the Pixracer, we
currently need to lock down everything (instead of just this SPI bus)
for the time when the params are written.
Therefore, we need to keep this locking as short as possible.

This change makes the locking even shorter by moving all param_get and
param_name and param_size calls out of the lock.
2016-08-01 02:15:21 -07:00
David Sidrane
5e8d6375c9 Back Port nuttx_v3 FLASH based parameter hooks 2016-07-13 20:42:05 +02:00
Daniel Agar
b8b855f2aa param.c fix style 2016-06-26 17:36:45 -04:00
Lorenz Meier
3c2bd4f6dd Param interface: Only mark as changed if value changed 2016-06-26 22:29:14 +02:00
jwilson
a73ac821ab Fixes shared memory locking bug and eliminates the need for an AppsProm driver to reserve a shared memory region. 2016-06-22 08:57:06 +02:00
Julian Oes
11cc17b63a param_shmem: be less verbose 2016-06-07 22:10:56 +02:00
Julian Oes
93ada40bf9 param_shmem: removed a printf 2016-06-07 22:10:56 +02:00
Lorenz Meier
7398164fcc Updated PX4 use / API of low level GPIO and other hardware-centric system facilities 2016-05-28 14:56:17 +02:00
Daniel Agar
2487dbfc92 remove Wpacked and cleanup unused warning flags 2016-05-19 21:49:34 +02:00
Daniel Agar
9c32792017 param_test link libmsg_gen 2016-05-14 11:27:07 +02:00
Daniel Agar
76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar
d85e7732b4 fix param_test 2016-05-13 13:01:42 +02:00
Lorenz Meier
192510ee1c FMUv4 compile fix 2016-05-05 14:09:03 +02:00
Julian Oes
e3c9135ac2 param_shmem: fix bug where params didn't stick
There was the case where a param was changed on the Linux side but the
change did not get saved on the DSP side because the param was not in
the local list of changed params on the DSP side. On save, the param
index is now refreshed, and param_get is called on all params that have
changed. This is a hacky workaround but resolves the problem for now.
2016-04-26 10:21:01 +02:00
Julian Oes
a302e79bb6 param_shmem: be less chatty, printf cleanup 2016-04-24 20:03:10 +02:00
Julian Oes
22847e49e7 param_shmem: fix style 2016-04-12 13:15:50 +02:00
Julian Oes
9cfffc9747 param_shmem: do fsync after param write 2016-04-12 13:15:50 +02:00
Julian Oes
60d66dc23f param_shmem: before saving update the param 2016-04-05 13:02:53 +02:00
Julian Oes
4a1e9d610b param_shmem: fix the "unknown param id" bug
The recent workaround to flag all params as used did not include
param_for_used_index(). However, this function got used in the case if
one param had not been received by QGC and was requested by its index.
2016-03-22 20:38:11 +01:00
Julian Oes
61baef4b65 param_shmem: fix format 2016-03-18 11:26:29 +00:00
Julian Oes
06d7a9c491 param_shmem: fixes for params on Snapdragon
On Snapdragon we can't yet use the "used" mask for parameters and
therefore need to send all of them down to the ground station. All
params were set to used in an earlier commit but the count and index
function didn't reflect this change. This is fixed now, therefore we can
successfully receive all params in QGC.
2016-03-18 11:26:29 +00:00
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