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
cc9122a4
Commit
cc9122a4
authored
Oct 08, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ixed DEG MIN SEC display and changed headers to gpslib files
parent
751c0546
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
75 deletions
+51
-75
gps.c
sw/common/drivers/gps.c
+17
-32
gps.h
sw/common/drivers/gps.h
+27
-38
gpscoord.c
sw/freertos/src/apps/gpscoord.c
+6
-5
main.c
sw/freertos/src/main.c
+1
-0
No files found.
sw/common/drivers/gps.c
View file @
cc9122a4
/*
*==============================================================================
* CERN (BE-CO-HT)
* Source file for Antenova M10478 GPS module
*==============================================================================
* Copyright (C) 2014 Julian Lewis
* @author Theodor Stana <theodor.stana@gmail.com>
*
* author: Theodor Stana (t.stana@cern.ch)
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* date of creation: 2014-08-24
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* version: 1.0
*
* description:
*
* dependencies:
*
* references:
*
*==============================================================================
* GNU LESSER GENERAL PUBLIC LICENSE
*==============================================================================
* This source file is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This source is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details. You should have
* received a copy of the GNU Lesser General Public License along with this
* source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
*==============================================================================
* last changes:
* 2014-08-24 Theodor Stana t.stana@cern.ch File created
*==============================================================================
* TODO: -
*==============================================================================
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdio.h>
#include <string.h>
...
...
sw/common/drivers/gps.h
View file @
cc9122a4
/*
*==============================================================================
* CERN (BE-CO-HT)
* Header file for Antenova M10478 GPS module
*==============================================================================
* Copyright (C) 2014 Julian Lewis
* @author Theodor Stana <theodor.stana@gmail.com>
*
* author: Theodor Stana (t.stana@cern.ch)
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* date of creation: 2014-08-24
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* version: 1.0
*
* description:
*
* dependencies:
*
* references:
*
*==============================================================================
* GNU LESSER GENERAL PUBLIC LICENSE
*==============================================================================
* This source file is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version. This source is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details. You should have
* received a copy of the GNU Lesser General Public License along with this
* source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
*==============================================================================
* last changes:
* 2014-08-24 Theodor Stana t.stana@cern.ch File created
*==============================================================================
* TODO: -
*==============================================================================
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __GPS_H_
...
...
@@ -50,19 +34,24 @@
/*=================*/
/* Data structures */
/*=================*/
/*
* Latitude and longitude can have different formats, see gps_get_coord() for
* details
*/
struct
gps_coord
{
double
lat
;
double
lon
;
double
elev
;
};
/* UTC time from GPS */
struct
gps_utc
{
int
yr
;
int
mon
;
int
day
;
int
hr
;
int
min
;
int
sec
;
int
yr
;
// years since 1900
int
mon
;
// months since January (0-11)
int
day
;
// day of month
int
hr
;
// hours (0-23)
int
min
;
// minutes (0-59)
int
sec
;
// seconds (0-59)
};
/*=====================*/
...
...
sw/freertos/src/apps/gpscoord.c
View file @
cc9122a4
...
...
@@ -57,6 +57,7 @@ static void gps_redraw(struct ui_widget *w)
if
(
gps_fixed
())
gps_get_coord
(
&
coord
,
coord_format
);
/* Decompose degrees, mins, secs for formats 0 & 1 */
latdeg
=
coord
.
lat
/
100
;
latmin
=
100
*
(
latdeg
-
(
int
)
latdeg
);
latsec
=
coord
.
lat
-
(
int
)
coord
.
lat
;
...
...
@@ -84,20 +85,20 @@ static void gps_redraw(struct ui_widget *w)
/* [deg] [min] [sec] */
sprintf
(
buf
,
"L: %d deg"
,
(
int
)
latdeg
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
0
,
0
,
buf
,
0
);
sprintf
(
buf
,
"%d'%2.2f
''"
,
(
int
)
latmin
,
0
.
6
*
latsec
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
22
,
20
,
buf
,
0
);
sprintf
(
buf
,
"%d'%2.2f
\"
"
,
(
int
)
latmin
,
100
*
latsec
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
5
,
20
,
buf
,
0
);
sprintf
(
buf
,
"l: %d deg"
,
(
int
)
londeg
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
0
,
50
,
buf
,
0
);
sprintf
(
buf
,
"%d'%2.2f
''"
,
(
int
)
lonmin
,
6
0
*
lonsec
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
1
5
,
70
,
buf
,
0
);
sprintf
(
buf
,
"%d'%2.2f
\"
"
,
(
int
)
lonmin
,
10
0
*
lonsec
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
5
,
70
,
buf
,
0
);
}
else
if
(
coord_format
==
2
)
{
/* [deg].[min/60] */
sprintf
(
buf
,
"L: %2.4f"
,
coord
.
lat
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
0
,
0
,
buf
,
0
);
sprintf
(
buf
,
"l: %2.4f"
,
coord
.
lon
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
0
,
50
,
buf
,
0
);
gfx_text
(
&
w
->
dc
,
&
font_helv22b
,
5
,
50
,
buf
,
0
);
}
/* Display elevation */
}
else
{
...
...
sw/freertos/src/main.c
View file @
cc9122a4
/*
* Copyright (C) 2014 Julian Lewis
* @author Maciej Suminski <maciej.suminski@cern.ch>
* @author Theodor Stana <theodor.stana@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
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