[fix] call pprzlog_init if needed (and avoid segfault)

This commit is contained in:
Gautier Hattenberger
2015-01-30 21:25:34 +01:00
parent a4764decbe
commit 71f61cc3f4
3 changed files with 8 additions and 1 deletions
@@ -1,6 +1,6 @@
# Hey Emacs, this is a -*- makefile -*-
sdlog_CFLAGS = -DDOWNLINK
sdlog_CFLAGS = -DDOWNLINK -DUSE_PPRZLOG
sdlog_srcs = subsystems/datalink/downlink.c subsystems/datalink/pprzlog_transport.c
ap.CFLAGS += $(sdlog_CFLAGS)
@@ -75,6 +75,10 @@ void downlink_init(void)
#endif
#endif
#if USE_PPRZLOG
pprzlog_transport_init();
#endif
#if SITL
ivy_transport_init();
#endif
@@ -41,5 +41,8 @@ struct pprzlog_transport {
extern struct pprzlog_transport pprzlog_tp;
// Init function
extern void pprzlog_transport_init(void);
#endif