diff --git a/conf/firmwares/subsystems/fixedwing/gps_mediatek_diy.makefile b/conf/firmwares/subsystems/shared/gps_mediatek_diy.makefile similarity index 100% rename from conf/firmwares/subsystems/fixedwing/gps_mediatek_diy.makefile rename to conf/firmwares/subsystems/shared/gps_mediatek_diy.makefile diff --git a/sw/airborne/subsystems/gps/gps_mtk.c b/sw/airborne/subsystems/gps/gps_mtk.c index d5b35dc5bf..094ef6b71f 100644 --- a/sw/airborne/subsystems/gps/gps_mtk.c +++ b/sw/airborne/subsystems/gps/gps_mtk.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -/** @file gps_mtk.h +/** @file gps_mtk.c * @brief Mediatek MT3329 specific code * * supports: @@ -139,7 +139,7 @@ void gps_mtk_msg(void) } static void gps_mtk_time2itow(uint32_t gps_date, uint32_t gps_time, - int16_t *gps_week, uint32_t *gps_itow) + uint16_t *gps_week, uint32_t *gps_itow) { /* convert UTC date/time to GPS week/itow, we have no idea about GPS leap seconds for now */ diff --git a/sw/airborne/subsystems/gps/gps_mtk.h b/sw/airborne/subsystems/gps/gps_mtk.h index 26163c94b4..b416a43b4f 100644 --- a/sw/airborne/subsystems/gps/gps_mtk.h +++ b/sw/airborne/subsystems/gps/gps_mtk.h @@ -19,6 +19,17 @@ * Boston, MA 02111-1307, USA. */ +/** @file gps_mtk.h + * @brief Mediatek MT3329 specific code + * + * supports: + * DIYDrones V1.4 protocol (AXN1.30_2278) + * DIYDrones V1.6 protocol (AXN1.30_2389) + * + * documentation is partly incorrect, see mtk.xml for what seems + * to be "real" + * + */ #ifndef MTK_H #define MTK_H @@ -57,6 +68,8 @@ extern struct GpsMtk gps_mtk; #include "pprzlink/pprzlink_device.h" #ifdef GPS_CONFIGURE +extern void gps_configure(void); +extern void gps_configure_uart(void); extern bool_t gps_configuring; #define GpsConfigure() { \ if (gps_configuring) \ @@ -68,6 +81,7 @@ extern bool_t gps_configuring; extern void gps_mtk_read_message(void); extern void gps_mtk_parse(uint8_t c); +extern void gps_mtk_msg(void); static inline void GpsEvent(void) { @@ -82,12 +96,4 @@ static inline void GpsEvent(void) } } -/* - * dynamic GPS configuration - */ -#ifdef GPS_CONFIGURE -extern void gps_configure(void); -extern void gps_configure_uart(void); -#endif - #endif /* MTK_H */ diff --git a/sw/tools/generators/gen_mtk.ml b/sw/tools/generators/gen_mtk.ml index 835d9292ff..ec34e99c1c 100644 --- a/sw/tools/generators/gen_mtk.ml +++ b/sw/tools/generators/gen_mtk.ml @@ -105,7 +105,8 @@ let parse_message = fun class_name m -> if l <> !offset then raise (Length_error (m, l, !offset)) with Xml.No_attribute("length") -> () (** Undefined length authorized *) - end + end; + fprintf out "\n#define MTK_%s_%s_LENGTH %d\n" class_name msg_name !offset let parse_class = fun c ->