Skip to content

Commit

Permalink
Make parameter generation also depend on the scripts that run. Addres…
Browse files Browse the repository at this point in the history
…s some review comments.
  • Loading branch information
stephanbro authored and bkueng committed Jan 6, 2017
1 parent 92b2395 commit 67a484a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
6 changes: 0 additions & 6 deletions Tools/px_generate_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,13 @@
struct px4_parameters_t {
"""
start_name = ""
end_name = ""

params = []
for group in root:
if group.tag == "group" and "no_code_generation" not in group.attrib:
for param in group:
scope_ = param.find('scope').text
if not cmake_scope.Has(scope_):
continue
if not start_name:
start_name = param.attrib["name"]
end_name = param.attrib["name"]
params.append(param)

params = sorted(params, key=lambda name: name.attrib["name"])
Expand Down
3 changes: 2 additions & 1 deletion cmake/common/px4_base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,8 @@ function(px4_generate_parameters_xml)
add_custom_command(OUTPUT ${OUT}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
-s ${path} --board CONFIG_ARCH_${BOARD} --xml --inject-xml --scope ${SCOPE}
DEPENDS ${param_src_files}
DEPENDS ${param_src_files} ${PX4_SOURCE_DIR}/Tools/px_process_params.py
${PX4_SOURCE_DIR}/Tools/px_generate_params.py
)
set(${OUT} ${${OUT}} PARENT_SCOPE)
endfunction()
Expand Down
4 changes: 2 additions & 2 deletions src/modules/systemlib/param/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ param_find_internal(const char *name, bool notification)
{
param_t middle;
param_t front = 0;
param_t last = get_param_info_count() - 1;
param_t last = get_param_info_count();

/* perform a binary search of the known parameters */

Expand All @@ -278,7 +278,7 @@ param_find_internal(const char *name, bool notification)

return middle;

} else if (middle == front || middle == last) {
} else if (middle == front) {
/* An end point has been hit, but there has been no match */
break;

Expand Down
2 changes: 1 addition & 1 deletion src/systemcmds/param/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ do_find(const char *name)
return 1;
}

printf("Found param %s at index %lu\n", name, ret);
printf("Found param %s at index %"PRIxPTR"\n", name, ret);
return 0;
}

Expand Down

0 comments on commit 67a484a

Please sign in to comment.