-static __xdata char ao_gps_char;
-static __xdata uint8_t ao_gps_cksum;
-static __xdata uint8_t ao_gps_error;
-
-__xdata uint16_t ao_gps_tick;
-__xdata struct ao_gps_data ao_gps_data;
-__xdata struct ao_gps_tracking_data ao_gps_tracking_data;
-
-static __xdata uint16_t ao_gps_next_tick;
-static __xdata struct ao_gps_data ao_gps_next;
-static __xdata uint8_t ao_gps_date_flags;
-static __xdata struct ao_gps_tracking_data ao_gps_tracking_next;
-
-static const char ao_gps_config[] = {
- 0xa0, 0xa1, 0x00, 0x09, /* length 9 bytes */
- 0x08, /* configure nmea */
- 1, /* gga interval */
- 1, /* gsa interval */
- 1, /* gsv interval */
- 1, /* gll interval */
- 1, /* rmc interval */
- 1, /* vtg interval */
- 1, /* zda interval */
- 0, /* attributes (0 = update to sram, 1 = update flash too) */
- 0x09, 0x0d, 0x0a,
-
- 0xa0, 0xa1, 0x00, 0x03, /* length: 3 bytes */
- 0x3c, /* configure navigation mode */
- 0x00, /* 0 = car, 1 = pedestrian */
- 0x00, /* 0 = update to sram, 1 = update sram + flash */
- 0x3c, 0x0d, 0x0a,
+static __pdata char ao_gps_char;
+static __pdata uint8_t ao_gps_cksum;
+static __pdata uint8_t ao_gps_error;
+
+__pdata uint16_t ao_gps_tick;
+__xdata struct ao_telemetry_location ao_gps_data;
+__xdata struct ao_telemetry_satellite ao_gps_tracking_data;
+
+static __pdata uint16_t ao_gps_next_tick;
+static __xdata struct ao_telemetry_location ao_gps_next;
+static __pdata uint8_t ao_gps_date_flags;
+static __xdata struct ao_telemetry_satellite ao_gps_tracking_next;
+
+#define STQ_S 0xa0, 0xa1
+#define STQ_E 0x0d, 0x0a
+#define SKYTRAQ_MSG_2(id,a,b) \
+ STQ_S, 0, 3, id, a,b, (id^a^b), STQ_E
+#define SKYTRAQ_MSG_3(id,a,b,c) \
+ STQ_S, 0, 4, id, a,b,c, (id^a^b^c), STQ_E
+#define SKYTRAQ_MSG_8(id,a,b,c,d,e,f,g,h) \
+ STQ_S, 0, 9, id, a,b,c,d,e,f,g,h, (id^a^b^c^d^e^f^g^h), STQ_E
+#define SKYTRAQ_MSG_14(id,a,b,c,d,e,f,g,h,i,j,k,l,m,n) \
+ STQ_S, 0,15, id, a,b,c,d,e,f,g,h,i,j,k,l,m,n, \
+ (id^a^b^c^d^e^f^g^h^i^j^k^l^m^n), STQ_E
+
+static __code uint8_t ao_gps_config[] = {
+ SKYTRAQ_MSG_8(0x08, 1, 1, 1, 1, 1, 1, 1, 0), /* configure nmea */
+ /* gga interval */
+ /* gsa interval */
+ /* gsv interval */
+ /* gll interval */
+ /* rmc interval */
+ /* vtg interval */
+ /* zda interval */
+ /* attributes (0 = update to sram, 1 = update flash too) */
+
+ SKYTRAQ_MSG_2(0x3c, 0x00, 0x00), /* configure navigation mode */
+ /* 0 = car, 1 = pedestrian */
+ /* 0 = update to sram, 1 = update sram + flash */