30 #ifndef SYS_TIME_FREQUENCY
31 #error SYS_TIME_FREQUENCY should be defined in Makefile.chibios or airframe.xml and be equal to CH_CFG_ST_FREQUENCY
32 #elif SYS_TIME_FREQUENCY != CH_CFG_ST_FREQUENCY
33 #error SYS_TIME_FREQUENCY should be equal to CH_CFG_ST_FREQUENCY
34 #elif CH_CFG_ST_FREQUENCY < (2 * PERIODIC_FREQUENCY)
35 #error CH_CFG_ST_FREQUENCY and SYS_TIME_FREQUENCY should be >= 2 x PERIODIC_FREQUENCY
40 #define Fbw(f) f ## _fbw()
47 #define Ap(f) f ## _ap()
52 #if USE_HARD_FAULT_RECOVERY
59 static void thd_ap(
void *arg);
77 #if USE_HARD_FAULT_RECOVERY
79 if (!recovering_from_hard_fault) {
82 #if USE_HARD_FAULT_RECOVERY
89 chThdSleepMilliseconds(100);
92 fbwThdPtr = chThdCreateStatic(wa_thd_fbw,
sizeof(wa_thd_fbw), NORMALPRIO,
thd_fbw, NULL);
93 #if USE_HARD_FAULT_RECOVERY
95 if (!recovering_from_hard_fault) {
97 apThdPtr = chThdCreateStatic(wa_thd_ap,
sizeof(wa_thd_ap), NORMALPRIO,
thd_ap, NULL);
98 #if USE_HARD_FAULT_RECOVERY
104 chThdSleepMilliseconds(1000);
117 chRegSetThreadName(
"AP");
119 while (!chThdShouldTerminateX()) {
122 chThdSleepMicroseconds(500);
136 chRegSetThreadName(
"FBW");
138 while (!chThdShouldTerminateX()) {
141 chThdSleepMicroseconds(500);
static thread_t * apThdPtr
static void thd_ap(void *arg)
AP ( AutoPilot ) process API.
int main(void)
Main function.
STATIC_INLINE void handle_periodic_tasks(void)
Architecture independent timing functions.
static thread_t * fbwThdPtr
Arch independent mcu ( Micro Controller Unit ) utilities.
Common code for AP and FBW telemetry.
FBW ( FlyByWire ) process API.
void pprz_terminate_autopilot_threads(void)
Terminate all autopilot threads Wait until proper stop.
static void thd_fbw(void *arg)
static THD_WORKING_AREA(wa_thd_ap, 8192)