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.
This commit is contained in:
Julian Oes 2016-03-17 11:02:51 +00:00
parent 213cdf1a91
commit 06d7a9c491

View File

@ -307,6 +307,8 @@ param_count(void)
unsigned
param_count_used(void)
{
//TODO FIXME: all params used right now
#if 0
unsigned count = 0;
// ensure the allocation has been done
@ -322,6 +324,9 @@ param_count_used(void)
}
return count;
#else
return get_param_info_count();
#endif
}
param_t
@ -378,6 +383,8 @@ param_get_index(param_t param)
int
param_get_used_index(param_t param)
{
// TODO FIXME: the used bit is not supported right now, therefore just count all.
#if 0
/* this tests for out of bounds and does a constant time lookup */
if (!param_used(param)) {
return -1;
@ -388,6 +395,7 @@ param_get_used_index(param_t param)
for (unsigned i = 0; i < (unsigned)size_param_changed_storage_bytes; i++) {
for (unsigned j = 0; j < bits_per_allocation_unit; j++) {
if (param_changed_storage[i] & (1 << j)) {
if ((unsigned)param == i * bits_per_allocation_unit + j) {
@ -398,8 +406,11 @@ param_get_used_index(param_t param)
}
}
}
return -1;
#else
return param;
#endif
}
const char *