Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
9743c334
Commit
9743c334
authored
Jan 22, 2015
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed GPS fix status storage in GPS driver
parent
8554978d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
gps.c
sw/common/drivers/gps.c
+19
-2
No files found.
sw/common/drivers/gps.c
View file @
9743c334
...
...
@@ -45,6 +45,8 @@ static volatile int irq_sync = 0;
static
nmeaINFO
info
;
static
nmeaPARSER
parser
;
static
int
fixed
;
__attribute__
((
__weak__
))
void
LEUART0_IRQHandler
()
{
...
...
@@ -111,6 +113,9 @@ void gps_init(int pulse_onoff)
/* NMEA parser & info structure init */
nmea_zero_INFO
(
&
info
);
nmea_parser_init
(
&
parser
);
/* We shouldn't have fix after init */
fixed
=
0
;
}
/**
...
...
@@ -131,6 +136,9 @@ void gps_on_off_pulse()
/* Delay to make sure GPS module sees this as a pulse */
for
(
i
=
0
;
i
<
100000
;
i
++
)
;
/* Turn on and off should mean we lost fix */
fixed
=
0
;
}
/**
...
...
@@ -144,6 +152,7 @@ void gps_on_off_pulse()
void
gps_reset
(
int
val
)
{
val
?
GPIO_PinOutClear
(
gpioPortF
,
5
)
:
GPIO_PinOutSet
(
gpioPortF
,
5
);
fixed
=
0
;
}
/**
...
...
@@ -185,6 +194,14 @@ void gps_parse_nmea(const char *buf)
{
// TODO: check return of nmea_parse
nmea_parse
(
&
parser
,
buf
,
strlen
(
buf
),
&
info
);
fixed
=
info
.
sig
;
/* On turn-off string from GPS module, set fixed to zero */
if
(
strcmp
(
buf
,
"$PSRF150,0*3F
\r\n
"
)
==
0
)
{
fixed
=
0
;
}
#ifdef DEBUG
/*
* NOTE: usbdbg_init() should be called EXTERNALLY, BEFORE gps_init() is
...
...
@@ -196,7 +213,7 @@ void gps_parse_nmea(const char *buf)
/**
* @brief
* Return the fix state of the GPS receiver
j
* Return the fix state of the GPS receiver
* @return
* 0 when the GPS is not fixed
* 1 when we have fix
...
...
@@ -205,7 +222,7 @@ void gps_parse_nmea(const char *buf)
*/
int
gps_fixed
()
{
return
info
.
sig
;
return
fixed
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment