projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altosui: add tool-tips to the button box.
[fw/altos]
/
src
/
ao_gps_skytraq.c
diff --git
a/src/ao_gps_skytraq.c
b/src/ao_gps_skytraq.c
index 84743ff53f92da48742c1e5571ed7e483638bca2..7ac269469d31c2bc90c42c6d92c0c9b5adb4b95e 100644
(file)
--- a/
src/ao_gps_skytraq.c
+++ b/
src/ao_gps_skytraq.c
@@
-21,20
+21,20
@@
#define AO_GPS_LEADER 2
#define AO_GPS_LEADER 2
-static
const
char ao_gps_header[] = "GP";
+static
__code
char ao_gps_header[] = "GP";
__xdata uint8_t ao_gps_mutex;
__xdata uint8_t ao_gps_mutex;
-static __
x
data char ao_gps_char;
-static __
x
data uint8_t ao_gps_cksum;
-static __
x
data uint8_t ao_gps_error;
+static __data char ao_gps_char;
+static __
p
data uint8_t ao_gps_cksum;
+static __
p
data uint8_t ao_gps_error;
-__
x
data uint16_t ao_gps_tick;
+__
p
data uint16_t ao_gps_tick;
__xdata struct ao_telemetry_location ao_gps_data;
__xdata struct ao_telemetry_satellite ao_gps_tracking_data;
__xdata struct ao_telemetry_location ao_gps_data;
__xdata struct ao_telemetry_satellite ao_gps_tracking_data;
-static __
x
data uint16_t ao_gps_next_tick;
+static __
p
data uint16_t ao_gps_next_tick;
static __xdata struct ao_telemetry_location ao_gps_next;
static __xdata struct ao_telemetry_location ao_gps_next;
-static __
x
data uint8_t ao_gps_date_flags;
+static __
p
data uint8_t ao_gps_date_flags;
static __xdata struct ao_telemetry_satellite ao_gps_tracking_next;
#define STQ_S 0xa0, 0xa1
static __xdata struct ao_telemetry_satellite ao_gps_tracking_next;
#define STQ_S 0xa0, 0xa1
@@
-49,7
+49,7
@@
static __xdata struct ao_telemetry_satellite ao_gps_tracking_next;
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
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
const
uint8_t ao_gps_config[] = {
+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 */
SKYTRAQ_MSG_8(0x08, 1, 1, 1, 1, 1, 1, 1, 0), /* configure nmea */
/* gga interval */
/* gsa interval */
@@
-89,13
+89,13
@@
ao_gps_skip_sep(void)
ao_gps_lexchar();
}
ao_gps_lexchar();
}
-__
x
data static uint8_t ao_gps_num_width;
+__
p
data static uint8_t ao_gps_num_width;
static int16_t
ao_gps_decimal(uint8_t max_width)
{
int16_t v;
static int16_t
ao_gps_decimal(uint8_t max_width)
{
int16_t v;
- __
x
data uint8_t neg = 0;
+ __
p
data uint8_t neg = 0;
ao_gps_skip_sep();
if (ao_gps_char == '-') {
ao_gps_skip_sep();
if (ao_gps_char == '-') {
@@
-238,14
+238,14
@@
ao_nmea_gga()
ao_gps_next.flags |= i;
ao_gps_lexchar();
ao_gps_next.flags |= i;
ao_gps_lexchar();
-
ao_gps_next.hdop
= ao_gps_decimal(0xff);
- if (
ao_gps_next.hdop
<= 50) {
-
ao_gps_next.hdop = (uint8_t) 5 * ao_gps_next.hdop
;
+
i
= ao_gps_decimal(0xff);
+ if (
i
<= 50) {
+
i = (uint8_t) 5 * i
;
if (ao_gps_char == '.')
if (ao_gps_char == '.')
- ao_gps_next.hdop = (ao_gps_next.hdop +
- ((uint8_t) ao_gps_decimal(1) >> 1));
+ i = (i + ((uint8_t) ao_gps_decimal(1) >> 1));
} else
} else
- ao_gps_next.hdop = 255;
+ i = 255;
+ ao_gps_next.hdop = i;
ao_gps_skip_field();
ao_gps_next.altitude = ao_gps_decimal(0xff);
ao_gps_skip_field();
ao_gps_next.altitude = ao_gps_decimal(0xff);
@@
-390,15
+390,16
@@
ao_nmea_rmc(void)
}
}
}
}
-#define ao_skytraq_sendstruct(s) ao_skytraq_sendbytes((s),
(s)+
sizeof(s))
+#define ao_skytraq_sendstruct(s) ao_skytraq_sendbytes((s), sizeof(s))
static void
static void
-ao_skytraq_sendbytes(
const uint8_t *b, const uint8_t *e
)
+ao_skytraq_sendbytes(
__code uint8_t *b, uint8_t l
)
{
{
- while (b != e) {
- if (*b == 0xa0)
+ while (l--) {
+ uint8_t c = *b++;
+ if (c == 0xa0)
ao_delay(AO_MS_TO_TICKS(500));
ao_delay(AO_MS_TO_TICKS(500));
- ao_serial_putchar(
*b++
);
+ ao_serial_putchar(
c
);
}
}
}
}