diff --git a/conf/firmwares/subsystems/rotorcraft/gps_udp.makefile b/conf/firmwares/subsystems/rotorcraft/gps_udp.makefile index df238a85dc..2e66bd7722 100644 --- a/conf/firmwares/subsystems/rotorcraft/gps_udp.makefile +++ b/conf/firmwares/subsystems/rotorcraft/gps_udp.makefile @@ -3,7 +3,7 @@ GPS_LED ?= none ap.srcs += $(SRC_SUBSYSTEMS)/gps.c -ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\" +ap.CFLAGS += -DPRIMARY_GPS_TYPE_H=\"subsystems/gps/gps_udp.h\" ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_udp.c ap.CFLAGS += -DUSE_GPS @@ -14,5 +14,5 @@ endif nps.CFLAGS += -DUSE_GPS nps.srcs += $(SRC_SUBSYSTEMS)/gps.c -nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\" +nps.CFLAGS += -DPRIMARY_GPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\" nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c diff --git a/sw/airborne/subsystems/gps/gps_udp.c b/sw/airborne/subsystems/gps/gps_udp.c index 7c54d3e0af..3742c53f96 100644 --- a/sw/airborne/subsystems/gps/gps_udp.c +++ b/sw/airborne/subsystems/gps/gps_udp.c @@ -94,3 +94,10 @@ void gps_parse(void) } } +/* + * register callbacks & structs + */ +void udp_gps_register(void) +{ + gps_register_impl(udp_gps_impl_init, gps_parse, GPS_UDP_ID, 0); +} diff --git a/sw/airborne/subsystems/gps/gps_udp.h b/sw/airborne/subsystems/gps/gps_udp.h index cc50687eff..2b383fc7f6 100644 --- a/sw/airborne/subsystems/gps/gps_udp.h +++ b/sw/airborne/subsystems/gps/gps_udp.h @@ -3,10 +3,18 @@ #include "std.h" -#define GPS_NB_CHANNELS 16 +#define UDP_GPS_NB_CHANNELS 16 + +#ifndef PrimaryGpsImpl +#define PrimaryGpsImpl udp +#endif + extern void gps_parse(void); +extern void udp_gps_impl_init(void); +extern void udp_gps_register(void); -#define GpsEvent gps_parse + +// #define GpsEvent gps_parse #endif /* GPS_UDP_H */