Randy Mackay
df6c666740
AP_Common: add AP_ExpandingGeneric to reduce code size
2019-06-20 15:09:23 +09:00
Randy Mackay
4ef3005d2c
AP_Common: add AP_ExpandingArray delete
2019-06-20 15:09:23 +09:00
Randy Mackay
2cb89d9a02
AP_Common: expanding array uses realloc
...
also make chunk_size const and recommend factor of 2
also reduce top level array's initial size to 32 elements
2019-06-20 15:09:23 +09:00
Randy Mackay
073ce8c3db
AP_ExpandingArray: add class description and remove default constructor
...
also made the following changes:
replaced delete with free
renamed chunk_ptr typedef to chunk_ptr_t
2019-06-20 15:09:23 +09:00
Randy Mackay
528e7c60b0
AP_Common: add AP_ExpandingArray class
2019-06-20 15:09:23 +09:00
Peter Barker
b48c729bb1
AP_Common: add os_sw_version to AP_FWVersion
2019-06-18 10:54:01 +10:00
Michael du Breuil
6e0cceff0d
AP_Common: Remove extra comparison from longitude_scale()
2019-06-18 10:09:09 +10:00
Peter Barker
4e5842a150
AP_Common: add initialised() method to Location
...
Sometimes code paths are crossed when they shouldn't be. This method
can help in the short term if a codepath is calling methods on a
Location when it is not initialised, but generally a vehicle should be
calling position_ok() and other methods rather than this one.
2019-06-18 09:07:56 +09:00
Peter Barker
ab7ee4fefb
AP_Common: Location.cpp: add sanity checks
2019-05-29 09:04:37 +09:00
Peter Barker
9d4bdbf3d5
AP_Common: add sanity check into bitmask get/set
...
Also return false if we are asked about an out-of-bounds bit
2019-05-28 09:43:17 +10:00
Andrew Tridgell
75397c1734
AP_Common: removed old Semaphore.h
...
now moved to AP_HAL/Semaphores.h
2019-05-15 15:33:48 +10:00
Peter Barker
71d16557fa
AP_Common: Location: add WARN_IF_UNUSED to boolean methods
2019-05-09 13:03:49 +10:00
Pierre Kancir
ff4587a33a
AP_Math: move location define to Location class
2019-04-23 09:20:43 +10:00
Pierre Kancir
4f31c3dcd5
AP_Math: move line_path_proportion to Location
2019-04-23 09:20:43 +10:00
Pierre Kancir
e06d7dbbf7
AP_Math: move location_passed_point to Location and rename
2019-04-23 09:20:43 +10:00
Peter Barker
e51a0a7a52
AP_Common: make Bitmask a template on number of bits
2019-04-16 15:12:07 +10:00
Peter Barker
2352dd3f12
AP_Common: clean includes up in Location.h
2019-04-16 10:00:29 +10:00
Pierre Kancir
121e5d0abf
AP_Math: move location_3d_diff_NED to Location and rename
2019-04-09 20:59:48 +10:00
Pierre Kancir
29b2d7996b
AP_Common: move check_latlng to Location
2019-04-08 12:56:01 -07:00
Pierre Kancir
b10e75f4e1
AP_Math: move locations_are_same to Location and rename to same_latlon_as
2019-04-08 08:05:05 -07:00
Pierre Kancir
00fa07ef33
AP_Math: move location_diff to Location and rename
2019-04-08 08:00:52 -07:00
Pierre Kancir
a30404fb11
AP_Common: move location_update to Location and rename to offset_bearing
2019-04-06 09:10:28 +11:00
Pierre Kancir
6faf1d2849
AP_Common: move get_bearing_cd to Location and rename to get_bearing_to
2019-04-06 09:10:28 +11:00
Peter Barker
a6755b6406
AP_Common: correct type conversion issues in _assert_storage_size
2019-04-05 05:48:41 -07:00
Peter Barker
fd294101ec
AP_Common: Location: move sanitize to be a method on location
2019-04-02 10:19:38 +11:00
murata
7340502f18
AP_Common: Set the value of UINT16 with HIGH byte and LOW byte
2019-03-28 12:02:55 +11:00
Peter Barker
649130adcb
AP_Common: uniqify semaphore names
2019-03-23 11:23:07 +11:00
Peter Barker
22c0175d7f
AP_Location: use enum class for AltFrame enumeration
2019-03-19 10:31:18 +11:00
Peter Barker
a1c751919c
AP_Common: move longitude_scale into Location class
2019-03-12 10:11:12 +11:00
Tom Pittenger
785c91e269
AP_Common: Semaphore is missing an include
...
Everyone who is already including common/Semaphore has extra includes to make this compile. This reduces that dependancy
2019-03-08 17:24:48 -08:00
Peter Barker
7f63720257
AP_Common: Location.cpp: force handling of all alt frames
...
By removing the default case we will generate a compiler error a new alt
frame is not handled
2019-03-05 10:39:29 +11:00
Peter Barker
c3004bff20
AP_Common: remove keywords.txt
2019-02-17 00:29:38 -08:00
Peter Barker
b97f9cc555
AP_Common: remove NuttX/C++10-related code
2019-02-15 08:15:45 +11:00
Peter Barker
7259f3fa2f
AP_Common: rearrange headers for consistency
...
Move attribute definitions all into AP_Common, rather than being split between two files
Remove unused SITL_printf macros
Stop AP_Common including board information
Include AP_Common.h in AP_HAL::Sempahore for WARN_IF_UNUSED; this was the cause of a circular import problem fixed by other commits in this patch.
2019-02-15 08:15:45 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
8b54b6a5cf
AP_Common: Move LOCATION_ALT_MAX_M declaration from AP_Common.h to Location.h
...
This reduces the scope of this constant, and moves it to the file that actually depends on it
2019-02-13 11:53:18 +09:00
Peter Barker
57804e3118
AP_Common: unify Location_Class and Location
2019-01-16 11:45:29 +11:00
Peter Barker
a3a012b77e
AP_Common: remove packed nature of Location, move flags out of union
...
This saves ~2.5kB on fmuv3
2019-01-16 11:45:29 +11:00
Peter Barker
4dc157951b
AP_Common: add template to check structure size
...
This has the advantage of telling you what the sizes are
In file included from ../../libraries/AC_AttitudeControl/AC_PosControl.h:3:
../../libraries/AP_Common/AP_Common.h:103:3: fatal error: static_assert failed "wrong size"
static_assert(s == t, "wrong size");
^ ~~~~~~
../../libraries/AP_Common/AP_Common.h:147:52: note: in instantiation of template class 'assert_structure_size<12, 11>' requested here
assert_structure_size<sizeof(struct Location), 11> _assert_location_size;
2019-01-16 11:45:29 +11:00
Peter Barker
e198b0c7e6
AP_Common: Bitmask: choose builtin based on type for find_first_set
2018-12-10 12:52:41 +09:00
Peter Barker
a7ce326307
AP_Common: Bitmask: use sizeof() in place of constant
2018-12-10 12:52:41 +09:00
Peter Barker
db5f933e7a
AP_Common: Bitmask: add assignment operator
2018-12-10 12:52:41 +09:00
Peter Barker
942555ceb8
AP_Common: add tests for Bitmask
2018-12-10 12:52:41 +09:00
Andrew Tridgell
0fcb22afde
AP_Common: added first_set() method to Bitmask
2018-12-10 12:52:41 +09:00
Peter Barker
09bdb6315b
AP_Common: define WEAK attribute
2018-12-10 12:52:41 +09:00
Peter Barker
6b7e04da06
AP_Common: Bitmask: remove copy operator and constructor
2018-11-05 12:17:55 +09:00
Lucas De Marchi
cb10d1d27b
AP_Common: allow more than one WITH_SEMAPHORE per context
...
Let the variable have a random name since we are not going to reference
it. This allows more than one WITH_SEMAPHORE() per context and also to
avoid shadowing if we open inner contexts.
2018-09-06 08:23:02 +10:00
Lucas De Marchi
1715714488
AP_Common: make WithSemaphore use an AP_HAL::Semaphore reference
...
We don't need the specialized one inside WithSemaphore, so use the
abstract one which allows us to more easily convert between current API
and the HAL_Semaphore one.
While at it also remove additional pragma and allow constructor to
receive a pointer for convenience (we will just dereference it).
2018-09-06 08:23:02 +10:00
Andrew Tridgell
0aeceb22d9
AP_Common: added #pragma once to Semaphores.h
2018-08-25 15:44:36 +10:00
Andrew Tridgell
912e4f16ec
AP_Common: added #pragma once
2018-08-23 08:21:48 +10:00
Andrew Tridgell
5ac15714fd
AP_Common: moved WITH_SEMAPHORE to Semaphore.h
2018-08-16 12:40:10 +10:00