Commit Graph

134 Commits

Author SHA1 Message Date
Andy Piper 578ca147b7 AP_Common: add UNUSED_PRIVATE_MEMBER 2022-03-03 16:34:14 +11:00
Peter Barker 51f8bba3a1 AP_Common: add STR_VALUE macro 2022-02-10 12:13:43 +11:00
Peter Barker 522b12135f AP_Common: correct UINT32_VALUE 2021-12-10 08:07:43 -08:00
murata 1e91dfe9d6 AP_Common: Make the char_to_hex method a common method 2021-11-09 10:16:25 +11:00
Andrew Tridgell 6c0c6a1f48 AP_Common: added CLASS_NO_COPY() macro
used to make it easy to forbid copy of classes
2021-06-08 11:14:52 +10:00
Randy Mackay d9de6e8de9 AP_Common: UINT16_VALUE, UINT32_VALUE get parentheses around arguments 2020-10-06 20:52:29 +11:00
Randy Mackay f3b193d6f8 AP_Common: add UINT32_VALUE 2020-10-06 20:52:29 +11:00
yaapu 6a0531c08a AP_Common: added missing bit set/clear functions 2020-09-02 05:56:46 +10:00
Andrew Tridgell 18deb1c0bd AP_Common: added strncpy_noterm
used to suppress string termination warnings
2020-07-10 13:32:24 +10:00
Andrew Tridgell b8f9f171e0 AP_Common: added IGNORE_RETURN() macro 2020-01-16 20:36:54 +11:00
murata a39228c453 AP_Common: Make hexadecimal character number conversion method common 2019-08-06 10:14:12 +10:00
Peter Barker a6755b6406 AP_Common: correct type conversion issues in _assert_storage_size 2019-04-05 05:48:41 -07: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 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 09bdb6315b AP_Common: define WEAK attribute 2018-12-10 12:52:41 +09: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 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
Andrew Tridgell 7aeab8f5a8 AP_Common: added ARRAY_SIZE_SIMPLE()
this works with zero length arrays
2018-01-15 11:46:02 +11: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 3102247a85 AP_Common: add FALLTHROUGH define 2017-08-22 23:59:13 -07: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
murata f9add59b58 Global: Aggregate the same definitions.
Global: Aggregate the same definitions.
2016-11-09 11:46:55 -03:00
Lucas De Marchi 6b88f3367b AP_Common: remove AP_PRODUCT_ID_* macros
These are not used anymore.
2016-11-09 17:08:05 +11: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
Lucas De Marchi 1962acad49 AP_Common: simplify ARRAY_SUBSCRIPT macro
Add DEFINE prefix, since this macro is defining these operators and
remove the parameter since we will always use it to access a
union/struct as a byte array.
2016-06-23 21:02:05 -03:00
Gustavo Jose de Sousa 5154369e9d AP_Common: define the ARRAY_SUBSCRIPT macro 2016-06-23 21:02:05 -03:00
Lucas De Marchi 8a58c06adb AP_Common: add macro to ignore unused result
In some cases we want to call functions annotated with
warn_unused_result but we know it's safe to ignore the return value.
Prefixing with (void) used to work, but it doesn't do anymore on all
versions of gcc and clang.
See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

This solution is a mix of the solutions provided in the above bug report
and the one provided by Gustavo Sousa at
https://github.com/ArduPilot/ardupilot/pull/4277#issuecomment-224957375
2016-06-23 18:34:01 -03:00
Lucas De Marchi 7703e5f1d1 AP_Common: remove support for flymaple 2016-05-23 21:49:45 -03:00
Andrew Tridgell 5f7af390ec AP_Common: a useful debug macro for SITL 2016-05-23 10:10:29 +10:00
Tom Pittenger 02eeb2d4f0 AP_Common: 1of3 add loiter_xtrack option flag for post-loiter navigation
0 to crosstrack from center of waypoint, 1 to crosstrack from tangent exit location
2016-05-16 11:50:53 -07:00
Ricardo de Almeida Gonzaga a8889e5765 AP_Common: Fix typos 2016-05-13 19:20:05 -03:00
Randy Mackay cd999a2091 Location: initial class implementation 2016-04-30 10:33:01 +09:00
Lucas De Marchi bac29be0b7 AP_Common: remove warnings from headers
Let the warning flag be added by the build system and not when/if the
header AP_Common.h is included. Both waf and make were already updated
to contain these warnings. Besides being in the wrong place, with
clang++ we actually can't add "-Wno-" definitions in build system
because we enable all of the in the header with -Wall.
2016-02-12 20:41:30 +11:00
Andrew Tridgell 285294a9cd AP_Common: added debug code for qurt
and disable some warnings for clang++ on qurt
2015-12-27 16:21:25 +11:00
Tom Pittenger 41746733fe AP_Common: remove crazy #define float double
- not creating a warning buuuuuut this is just sooooo bad that it must be nuked on the spot
2015-12-07 15:50:07 +09:00
Lucas De Marchi d19c5035b6 Global: Rename printf format attribute
As commented in 8218140 ("AP_Common: add scanf format macro"), "FORMAT"
was a bad name for this macro since there's also the scanf. Rename to
FMT_PRINTF to follow the scanf name.
2015-12-01 07:22:12 +11:00
Andrew Tridgell 8739c55d27 AP_Common: added ID for FMUv4 2015-11-27 18:54:30 +11:00
Andrew Tridgell 090c02e6bd AP_Common: rename is_bounded() to is_bounded_int32() and make inclusive
we will probably want float versions in future, and inclusive is
better for the RC_Channel case
2015-11-11 13:45:05 +11:00
Grant Morphett ba8dbf6696 AP_Common: Added a new is_bounded global function. 2015-11-11 13:39:39 +11:00