Commit Graph

40 Commits

Author SHA1 Message Date
Peter Barker fd888727b8 AP_GPS: add override keyword where required 2018-11-08 11:30:12 +11:00
Peter Barker 2354a0ec5a AP_GPS: ability to log GPS detection state to dataflash 2017-04-23 21:03:23 +01:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Gustavo Jose de Sousa 174cefa8a5 AP_GPS: use ARRAY_SUBSCRIPT instead of bytes field
That fixed compilation issues and seems more semantically correct. Using array
of length 0 fails compilation because of -Werror=array-bounds in GCC 6.1.
2016-06-23 21:02:05 -03:00
Andrew Tridgell af116d238f AP_GPS: use zero length flexible arrays
this works with gcc-6.1 and also works with asan. Hopefully it will
make coverity happy too.
2016-05-25 19:55:49 +10:00
Lucas De Marchi 39bd196481 AP_GPS: do not use flexible array in union
We actually don't want a flexible array in this union, but rather a way
to access it byte by byte. This fixes the build for gcc >= 6

In file included from ../../libraries/AP_GPS/AP_GPS.cpp:24:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_ERB.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_ERB.h:93:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK.cpp:25:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_MTK19.cpp:26:0:
../../libraries/AP_GPS/AP_GPS_MTK.h:75:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_SIRF.cpp:22:0:
../../libraries/AP_GPS/AP_GPS_SIRF.h:101:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.

In file included from ../../libraries/AP_GPS/AP_GPS_UBLOX.cpp:23:0:
../../libraries/AP_GPS/AP_GPS_UBLOX.h:387:23: error: flexible array member in union
         uint8_t bytes[];
                       ^
compilation terminated due to -Wfatal-errors.
2016-05-16 13:50:39 -03:00
Lucas De Marchi ff10d1136c AP_GPS: reorganize includes
Due to the way the headers are organized a single change in a
AP_GPS backend would trigger a rebuild for most of the files in the
project. Time could be saved by using ccache (since most of the things
didn't change) but we can do better, i.e.  re-organize
the headers so we don't have to re-build everything.

This makes internal headers internal and then other libraries only
depend on the AP_GPS.h header.
2016-04-14 21:01:51 -03:00
Lucas De Marchi cd266fbf4f AP_GPS: replace header guard with pragma once 2016-03-16 18:40:40 +11:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Gustavo Jose de Sousa 67db430583 AP_GPS: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Andrew Tridgell 0191355488 AP_GPS: fixed init strings to all be in progmem
and sent async ...
2014-04-01 06:38:25 +11:00
Andrew Tridgell 368daf89f1 AP_GPS: new GPS API
This is a complete rewrite of the GPS driver structure, with a static
main driver and separate backend drivers. This will allow proper
support for multiple GPSes, and will allow parameters to be set on the
GPS object
2014-04-01 06:38:23 +11:00
Andrew Tridgell 2dd92832dc AP_GPS: support multiple AP_GPS_Auto drivers
move all static variables into a dynamically allocated structure in
the AUTO driver which gets freed when we have found a GPS type
2014-04-01 06:38:23 +11:00
Andrew Tridgell 7ff293ca38 AP_GPS: added DataFlash to GPS init to allow for detailed logging
this will allow GPS drivers to log much more detailed device specific
information
2014-03-24 12:01:13 +11:00
Andrew Tridgell 9cf1fd46c8 AP_GPS: removed nav_setting default
not needed, and apparently caused issue with xcode 5.1
2014-03-14 07:49:56 +11:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell edfebc1f29 AP_GPS: fixed indent-tabs-mode 2013-05-30 09:52:21 +10:00
Andrew Tridgell 06b6f4b04e AP_GPS: use PACKED attribute instead of pragma pack 2013-05-09 20:10:31 +10:00
Andrew Tridgell f67480fa50 AP_GPS: ensure constructors zero all key variables
this prevents a crash on PX4 if a GPS is attached after startup
2013-02-20 11:33:39 +11:00
Andrew Tridgell 3bfff4bd6d AP_GPS: pragma pack is needed on ARM
we rely on GPS data structures having byte alignment. Luckily GCC can
cope with this.
2013-01-04 19:39:15 +11:00
Craig@3DR f778961acf Added support for Mediatek firmware Rev 1.9 2013-01-02 09:16:47 +11:00
Andrew Tridgell 18db7b2efd GPS: move _port setting to init()
this is needed to avoid constructor ordering dependencies
2012-12-20 14:52:32 +11:00
Pat Hickey 9ed023aeb4 AP_GPS: Builds under AP_HAL. Not tested. 2012-12-20 14:51:25 +11:00
Andrew Tridgell 59b44816ec GPS: replaced the GPS auto-detect mechanism
the old mechanism wasted most of the input bytes, and chewed a lot of
CPU, making it impractical to do GPS detection for a GPS attached
after startup

The new code is async, and detects a GPS by looking for a fully formed
packet with the right checksum for each GPS type
2012-09-17 14:45:47 +10:00
uncrustify a8ad5f62a5 uncrustify libraries/AP_GPS/AP_GPS_MTK.h 2012-08-21 19:02:40 -07:00
Andrew Tridgell ddf9541c0a AP_GPS: fixed build of new MTK code 2012-08-22 10:02:21 +10:00
Craig Elder 2493ffaad1 GPS: Corrections to Media Tek GPS Driver. Change to 5Hz and SBAS 2012-08-22 09:56:25 +10:00
Andrew Tridgell 33a2ad7e07 GPS: add stub settings for nav_setting in the other GPS drivers
only Ublox supports nav_setting so far
2012-06-10 16:34:53 +10:00
James Goppert 14d27b1e4c Cleaned up AP_GPS formatting. 2011-10-28 14:52:50 -04:00
james.goppert 7809b0ca2a Massive warning fixes.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@2089 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-04 19:12:27 +00:00
james.goppert aa598b575a APO merge.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1935 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-05-01 02:05:17 +00:00
DrZiplok@gmail.com 8da4a29d58 Add support for the DIYD MTK v1.6 firmware
Nuke AP_GPS_IMU, as nothing is using it anymore.
Simplify the handling of no GPS/no fix detection.
Fix prototypes for ::init and ::read.
Update AP_GPS_Auto and corresponding example, nearly ready for primetime.
Use uint8_t rather than byte.
Strip some _error() calls to save space.  More could still go.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1246 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-24 06:35:09 +00:00
james.goppert aa115aea68 AP_GPS libs now recover from disconnect or failed initialization.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1188 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-19 13:24:29 +00:00
DrZiplok@gmail.com 0a94520682 Add support for automatically detecting the connected GPS and configuring accordingly.
Note that this is currently disabled as changes need to be made to APM to support it.

Tested with MTK, u-blox and SiRF GPS'.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@671 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-10-17 06:06:04 +00:00
DrZiplok@gmail.com a83f663942 Private member naming
git-svn-id: https://arducopter.googlecode.com/svn/trunk@421 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-06 22:30:29 +00:00
DrZiplok@gmail.com add89239f3 Rework the MTK protocol decoder for robustness and code size.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@417 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-06 20:00:57 +00:00
DrZiplok@gmail.com 96a80f1c66 Cleanup.
Teach AP_GPS about FastSerial (in the few places it needs to know) and about Stream everywhere else.

Do some minor code cleanup.

Tested with Mega and uBlox.  Some issues (e.g. reporting 0 satelites) remain.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@404 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-06 09:20:44 +00:00
jasonshort 4b762bf933 New MTK codes
git-svn-id: https://arducopter.googlecode.com/svn/trunk@400 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-09-06 05:05:52 +00:00
jasonshort 4f02edac51 New GPS Lib
git-svn-id: https://arducopter.googlecode.com/svn/trunk@342 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-08-29 22:08:33 +00:00
jasonshort 2c6e096a3b New Libraries
git-svn-id: https://arducopter.googlecode.com/svn/trunk@286 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-08-24 04:13:27 +00:00