lockstep_scheduler: add generic lockstep component API

allows components to register and ensure the lockstep cycle waits for
all components to be updated.
This commit is contained in:
Beat Küng
2020-06-23 11:53:55 -04:00
committed by Daniel Agar
parent 55d06241b3
commit 5378d1468f
7 changed files with 313 additions and 2 deletions
+13
View File
@@ -194,6 +194,19 @@ __EXPORT extern void hrt_init(void);
__EXPORT extern hrt_abstime hrt_absolute_time_offset(void);
#endif
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
__EXPORT extern int px4_lockstep_register_component(void);
__EXPORT extern void px4_lockstep_unregister_component(int component);
__EXPORT extern void px4_lockstep_progress(int component);
__EXPORT extern void px4_lockstep_wait_for_components(void);
#else
static inline int px4_lockstep_register_component(void) { return 0; }
static inline void px4_lockstep_unregister_component(int component) { }
static inline void px4_lockstep_progress(int component) { }
static inline void px4_lockstep_wait_for_components(void) { }
#endif /* defined(ENABLE_LOCKSTEP_SCHEDULER) */
__END_DECLS