Commit Graph

416 Commits

Author SHA1 Message Date
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
Andrew Tridgell 6f058e8c0d AP_Common: added WithSemaphore class 2018-08-16 12:40:10 +10:00
Lucas De Marchi 88df4d127e AP_Common: remove ARRAY_SIZE_SIMPLE
Now this is basically ARRAY_SIZE, so remove it.
2018-08-04 15:31:55 +10:00
Lucas De Marchi 57ee0e29f6 AP_Common: simplify ARRAY_SIZE
This rolls back to the simpler version of ARRAY_SIZE. The more complex
one helps catching bugs when we use pointers when we are expecting an
array, but can't stand arrays with 0 elements.  I'm not aware of bugs it
actually caught on ArduPilot, although it did for me in other projects.

I think this is better than having a separate "_SIMPLE" version of the
macro and spread its usage... the trend is just to use the simpler
version anyway.
2018-08-04 15:31:55 +10:00
Peter Barker 6ba1678c5e AP_Common: AP_FWVersion: create singleton 2018-06-18 19:10:37 +01:00
Peter Barker dc202c1ff9 AP_Common: Location: use AP_AHRS singleton 2018-06-01 16:18:33 +01:00
Peter Barker 9a345160c1 AP_Common: fail attempts to use frame-above-home if home is not set 2018-06-01 16:18:33 +01:00
Peter Barker 28b4794816 AP_Common: remove unused HomeState 2018-05-29 14:38:45 +10:00
Francisco Ferreira f8756fac6b AP_Common: remove Qualcomm board support 2018-05-17 09:57:20 +10:00
Pierre Kancir 79cd137625 AP_Common: remove AP_AHRS_NavEKF include from location class 2018-04-11 08:59:50 +09:00
Andrew Tridgell 93bd546e6c AP_Common: fixed cygwin ChibiOS build
handle short path length errors
2018-03-02 17:11:31 +11:00
Andrew Tridgell 7aeab8f5a8 AP_Common: added ARRAY_SIZE_SIMPLE()
this works with zero length arrays
2018-01-15 11:46:02 +11:00
Peter Barker 302e5c6871 AP_Common: have get_vector_xy_from_origin_NE take a Vector2f rather than 3f
Also, rename it from get_vector_xy_from_origin_NED
2017-12-15 01:24:13 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 5a0ffe94d2 AP_Common: NFC spell in comments 2017-11-27 23:13:34 +09:00
Patrick José Pereira 9693da751e AP_common: Add stdio.h when using SITL_printf
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2017-10-24 22:55:56 +01:00
Lucas De Marchi 54a4a78795 AP_Common: do not include version.h/ap_version.h
The interface provided by each vehicle should be used to get the
version.
2017-09-23 21:37:45 -07:00
Lucas De Marchi 370e10281b AP_Common: AP_FWVersion: add pointers to git hash strings
Keeping the hash strings on this struct allow to handle them
the same way on common code and remove ifdefs.
2017-09-23 21:37:45 -07:00
squilter 1a9bccaaa7 AP_Common: fix Bitmask out-of-range values 2017-09-09 14:05:41 +09:00
Randy Mackay 963c9c93fe AP_Common: constify bitmask 2017-09-09 14:05:41 +09:00
Randy Mackay f187df225a AP_Common: add setall, count and size methods to Bitmask 2017-09-09 14:05:41 +09:00
Peter Barker 445777429b AP_FWVersion: add structure to hold firmware version 2017-08-30 15:54:46 +01:00
Randy Mackay aaac6b3692 AP_Common: Bitmask formatting fix 2017-08-30 20:07:04 +09:00
Lucas De Marchi 3102247a85 AP_Common: add FALLTHROUGH define 2017-08-22 23:59:13 -07:00
Andrew Tridgell 71158e3e74 AP_Common: added #pragma once 2017-05-06 15:21:14 +10:00
Pierre Kancir 2200302081 AP_Common: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
murata 50eead63cc AP_Common: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Dr.-Ing. Amilcar Do Carmo Lucas 8419045aea Spell in comments 2017-01-06 10:57:39 -08:00
Lucas De Marchi b0ddf81687 Remove stdbool.h include for C++ sources
This header is not needed in our C++ sources.
2016-12-16 11:38:52 -08:00
Andrew Tridgell 6adad11e2f AP_Common: added simple bitmask class 2016-12-02 09:49:39 +11:00
murata f9add59b58 Global: Aggregate the same definitions.
Global: Aggregate the same definitions.
2016-11-09 11:46:55 -03:00