27 #ifndef COMMON_FLIGHT_PLAN_H
28 #define COMMON_FLIGHT_PLAN_H
44 #define InitStage() nav_init_stage();
46 #define Block(x) case x: nav_block=x;
47 #define NextBlock() nav_goto_block(nav_block + 1)
48 #define GotoBlock(b) nav_goto_block(b)
50 #define Stage(s) case s: nav_stage=s;
51 #define NextStage() { nav_stage++; InitStage(); } INTENTIONAL_FALLTHRU
52 #define NextStageAndBreak() { nav_stage++; InitStage(); break; }
53 #define NextStageAndBreakFrom(wp) { last_wp = wp; NextStageAndBreak(); }
55 #define Label(x) label_ ## x:
56 #define Goto(x) { goto label_ ## x; }
57 #define Return(x) { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}
59 #define And(x, y) ((x) && (y))
60 #define Or(x, y) ((x) || (y))
61 #define Min(x,y) (x < y ? x : y)
62 #define Max(x,y) (x > y ? x : y)
63 #define LessThan(_x, _y) ((_x) < (_y))
64 #define MoreThan(_x, _y) ((_x) > (_y))
67 #define NavBlockTime() (block_time)
void nav_init_block(void)
void nav_goto_block(uint8_t block_id)
uint8_t last_block
To save the current block/stage to enable return.
void nav_init_stage(void)
needs to be implemented by fixedwing and rotorcraft seperately