projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/drivers: Use data ring values for MS5607 presentation
[fw/altos]
/
src
/
drivers
/
ao_gps_sirf.c
diff --git
a/src/drivers/ao_gps_sirf.c
b/src/drivers/ao_gps_sirf.c
index f2abbf84033c663e36d14745ad0663c28b773656..91fc948b466fa18935fd5d3b6d34f5f65ce4cc83 100644
(file)
--- a/
src/drivers/ao_gps_sirf.c
+++ b/
src/drivers/ao_gps_sirf.c
@@
-124,7
+124,13
@@
static __xdata struct sirf_measured_tracker_data ao_sirf_tracker_data;
static __pdata uint16_t ao_sirf_cksum;
static __pdata uint16_t ao_sirf_len;
static __pdata uint16_t ao_sirf_cksum;
static __pdata uint16_t ao_sirf_len;
-#define ao_sirf_byte() ((uint8_t) ao_serial_getchar())
+#ifndef ao_sirf_getchar
+#define ao_sirf_getchar ao_serial1_getchar
+#define ao_sirf_putchar ao_serial1_putchar
+#define ao_sirf_set_speed ao_serial1_set_speed
+#endif
+
+#define ao_sirf_byte() ((uint8_t) ao_sirf_getchar())
static uint8_t data_byte(void)
{
static uint8_t data_byte(void)
{
@@
-283,15
+289,15
@@
static void
ao_gps_setup(void) __reentrant
{
uint8_t i, k;
ao_gps_setup(void) __reentrant
{
uint8_t i, k;
- ao_s
erial
_set_speed(AO_SERIAL_SPEED_4800);
+ ao_s
irf
_set_speed(AO_SERIAL_SPEED_4800);
for (i = 0; i < 64; i++)
for (i = 0; i < 64; i++)
- ao_s
erial
_putchar(0x00);
+ ao_s
irf
_putchar(0x00);
for (k = 0; k < 3; k++)
for (i = 0; i < sizeof (ao_gps_set_nmea); i++)
for (k = 0; k < 3; k++)
for (i = 0; i < sizeof (ao_gps_set_nmea); i++)
- ao_s
erial
_putchar(ao_gps_set_nmea[i]);
- ao_s
erial
_set_speed(AO_SERIAL_SPEED_57600);
+ ao_s
irf
_putchar(ao_gps_set_nmea[i]);
+ ao_s
irf
_set_speed(AO_SERIAL_SPEED_57600);
for (i = 0; i < 64; i++)
for (i = 0; i < 64; i++)
- ao_s
erial
_putchar(0x00);
+ ao_s
irf
_putchar(0x00);
}
static const char ao_gps_set_message_rate[] = {
}
static const char ao_gps_set_message_rate[] = {
@@
-307,16
+313,16
@@
ao_sirf_set_message_rate(uint8_t msg, uint8_t rate) __reentrant
uint8_t i;
for (i = 0; i < sizeof (ao_gps_set_message_rate); i++)
uint8_t i;
for (i = 0; i < sizeof (ao_gps_set_message_rate); i++)
- ao_s
erial
_putchar(ao_gps_set_message_rate[i]);
- ao_s
erial
_putchar(msg);
- ao_s
erial
_putchar(rate);
+ ao_s
irf
_putchar(ao_gps_set_message_rate[i]);
+ ao_s
irf
_putchar(msg);
+ ao_s
irf
_putchar(rate);
cksum = 0xa6 + msg + rate;
for (i = 0; i < 4; i++)
cksum = 0xa6 + msg + rate;
for (i = 0; i < 4; i++)
- ao_s
erial
_putchar(0);
- ao_s
erial
_putchar((cksum >> 8) & 0x7f);
- ao_s
erial
_putchar(cksum & 0xff);
- ao_s
erial
_putchar(0xb0);
- ao_s
erial
_putchar(0xb3);
+ ao_s
irf
_putchar(0);
+ ao_s
irf
_putchar((cksum >> 8) & 0x7f);
+ ao_s
irf
_putchar(cksum & 0xff);
+ ao_s
irf
_putchar(0xb0);
+ ao_s
irf
_putchar(0xb3);
}
static const uint8_t sirf_disable[] = {
}
static const uint8_t sirf_disable[] = {
@@
-338,7
+344,7
@@
ao_gps(void) __reentrant
for (k = 0; k < 5; k++)
{
for (i = 0; i < sizeof (ao_gps_config); i++)
for (k = 0; k < 5; k++)
{
for (i = 0; i < sizeof (ao_gps_config); i++)
- ao_s
erial
_putchar(ao_gps_config[i]);
+ ao_s
irf
_putchar(ao_gps_config[i]);
for (i = 0; i < sizeof (sirf_disable); i++)
ao_sirf_set_message_rate(sirf_disable[i], 0);
ao_sirf_set_message_rate(41, 1);
for (i = 0; i < sizeof (sirf_disable); i++)
ao_sirf_set_message_rate(sirf_disable[i], 0);
ao_sirf_set_message_rate(41, 1);