Skip to content

Commit

Permalink
[return] reset_stage attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Oct 7, 2016
1 parent 81ad93f commit eac214d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion conf/flight_plans/flight_plan.dtd
Expand Up @@ -310,4 +310,5 @@ default_value CDATA #IMPLIED>

<!ATTLIST header>

<!ATTLIST return>
<!ATTLIST return
reset_stage CDATA "0">
3 changes: 1 addition & 2 deletions sw/airborne/subsystems/navigation/common_flight_plan.h
Expand Up @@ -54,8 +54,7 @@ void nav_goto_block(uint8_t block_id);

#define Label(x) label_ ## x:
#define Goto(x) { goto label_ ## x; }
#define Return() { nav_block=last_block; nav_stage=last_stage; block_time=0;}
#define ReturnToStartPrevBlock() { nav_block=last_block; nav_stage=0; block_time=0;}
#define Return(RESET_STAGE) { nav_block=last_block; if (RESET_STAGE==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}

#define And(x, y) ((x) && (y))
#define Or(x, y) ((x) || (y))
Expand Down
2 changes: 1 addition & 1 deletion sw/tools/generators/gen_flight_plan.ml
Expand Up @@ -324,7 +324,7 @@ let rec print_stage = fun index_of_waypoints x ->
match String.lowercase (Xml.tag x) with
"return" ->
stage ();
lprintf "Return();\n";
lprintf "Return(%s);\n" (ExtXml.attrib x "reset_stage");
lprintf "break;\n"
| "goto" ->
stage ();
Expand Down

0 comments on commit eac214d

Please sign in to comment.