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
9 years ago
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.
9 years ago
Andrew Tridgell
8739c55d27
AP_Common: added ID for FMUv4
9 years ago
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
9 years ago
Grant Morphett
ba8dbf6696
AP_Common: Added a new is_bounded global function.
9 years ago
Lucas De Marchi
821814007e
AP_Common: add scanf format macro
...
Add a macro to annotate functions that act like scanf. Calling the
printf format macro as FORMAT was bad as can be seen now. Later we need
to rename it to FMT_PRINTF.
9 years ago
Lucas De Marchi
b734777b95
AP_Common: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1
9 years ago
Lucas De Marchi
9203e2b929
AP_Common: remove PSTR definition
9 years ago
Lucas De Marchi
20c6ffc5e3
Replace use of UARTDriver::printf_P() with UARTDriver::printf()
...
This also starts to show warnings on places that were already using
wrong printf format strings.
9 years ago
Lucas De Marchi
dc95145de2
AP_Common: add attribute to sanitize prinf-like functions
...
Make the compiler emit warnings if the variables don't match the
printf format string. To be added in functions with printf-like
arguments.
9 years ago
Randy Mackay
acd8252e4b
Common: add location alt max definition
9 years ago
Lucas De Marchi
7ba6f92eb5
AP_Common: give some type safety to ARRAY_SIZE macro
...
Now that most places in the code use the ARRAY_SIZE macro instead of
coding it by hand, let's use some type safety in its definition. This is
a C++ version of similar macros used in kmod, Linux kernel and the
source of them, ccan.
A C++ version like this is used in V8 (the JS engine) and other open
source projects.
The main benefit of this version is that you get a compile error if you
pass in a variable that's not an array. For example,
Bla y[10];
Bla *y_ptr = y;
void foo(Bla x[])
{
// build error since x[] decay to a pointer in function
// parameter
for (int i = 0; i < ARRAY_SIZE(x); i++) {
...
}
// build error since y_ptr is not an array
for (int i = 0; i < ARRAY_SIZE(y_ptr); i++) {
...
}
}
I added the additional specialization to allow arrays of size 0.
10 years ago
Lucas De Marchi
82314ee4a3
AP_Common: add helper macro ARRAY_SIZE
10 years ago
Andrew Tridgell
a1a3212131
AP_Common: moved NOINLINE define to AP_Common.h
10 years ago
Andrew Tridgell
a53395cdb8
AP_Common: added HomeState enum from copter
10 years ago
Andrew Tridgell
26ac29840c
AP_Common: added UNUSED_FUNCTION macro
...
useful for functions that are only in some builds
10 years ago
Grant Morphett
0b4ac5d256
AP_Common: Changes to fix the warnings in rover sitl build.
...
We are starting the process of resolving all the warnings in the
ardupilot builds of all vehicles and platforms.
10 years ago
Andrew Tridgell
5980ff8e1c
AP_Common: removed map_baudrate()
...
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
10 years ago
Andrew Tridgell
37dea4e367
AP_Common: added MPU9250 product ID
10 years ago
Andrew Tridgell
8a48f06d18
AP_Common: added terrain_alt flag to Location
...
signifies that the altitude is a above terrain altitude
11 years ago
Victor Mayoral Vilches
1445781104
AP_Common: added fire cape product ID
11 years ago
Randy Mackay
b79f729540
AP_Common: add LOWBYTE, HIGHBYTE macros
11 years ago
Randy Mackay
fa16e0967f
AP_Common: remove unused location mask definitions
11 years ago
Andrew Tridgell
42c1501563
AP_Common: moved map_baudrate() into AP_Common
...
this version supports a much wider range of baudrates
11 years ago
Randy Mackay
e3ffd5c0dd
Common: remove RallyLocation defintion
11 years ago
Emile Castelnuovo
7b5c002d2f
AP_Common: new board ID for VRBRAIN
11 years ago
Andrew Tridgell
959cafef8d
AP_Common: make alt in Location 24 bit
...
this allows for up to 83km mission altitudes, while allowing for 1
more byte in the command structure, making p1 16 bits
11 years ago
Randy Mackay
865a4de33d
Common: use PACKED instead of pragma pack for Location
11 years ago
Randy Mackay
af186fba05
AP_Common: pack Location structure
...
This resolves issues storing and retrieving Location to eeprom as part
of AP_Mission
11 years ago
Randy Mackay
87126c9b71
Common: remove id and p1 from Location structure
...
id and p1 are now part of AP_Mission's Mission_Command structure
11 years ago
Randy Mackay
9ef27955b5
Common: add location options masks
11 years ago
Andrew Tridgell
77e8061170
AP_Common: added product ID for L3G4200D
12 years ago
Andrew Tridgell
86b58314c4
AP_Common: pack the RallyLocation structure
...
so it can be written as a single binary block
12 years ago
Michael Day
823a40c203
AP_Common: Added RallyLocation struct.
12 years ago
Andrew Tridgell
f1e120113c
AP_Common: added OPTIMIZE() macro
...
this can be used to change the compiler optimization level of
individual functions
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
12 years ago
Andrew Tridgell
c1d56f74b5
AP_Common: change flymaple product ID to 0x100
...
keep it well away from the Invensense product IDs for the MPU6000
12 years ago
Mike McCauley
8f61a36e58
AP_Common: Flymaple compatibility
12 years ago
Andrew Tridgell
8b80beadc4
PX4: make FMUv2 identify itself differently
...
so we can tell which is which in logs
12 years ago
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
12 years ago
Andrew Tridgell
62b9a580e8
AP_Common: make PACKED depend on architecture
...
this will remove lots of warnings when building with arduino
12 years ago
Andrew Tridgell
3659b532be
AP_Common: added BIT_IS_SET() macro
...
makes bit mask testing safer on PX4
Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
12 years ago
Andrew Tridgell
4fe5ce8a09
AP_Common: added a define for PACKED
...
neater than a pragma
12 years ago
Jochen Tuchbreiter
c5f19f5df8
Plane: Implement issue 80: counterclockwise loiter
...
- libraries/AP_Common/AP_Common.h: Use bit 2 of Location.options to store
loiter direction
- ArduPlane/defines.h: New bitmask MASK_OPTIONS_LOITER_DIRECTION for struct
Location bit 2
- ArduPlane/ArduPlane.pde: New variable loiter_direction
- ArduPlane/GCS_Mavlink.pde: For mavlink loiter-commands use sign of param3 to
detemine direction. Set Location.option flag accordingly
- ArduPlane/commands.pde: Make sure loiter-directions get saved into EEPROM
correctly
- ArduPlane/commands_logic.pde: Set loiter_direction on all loiter-actions
as well as RTL/instant loiter
- ArduPlane/navigation.pde: Yield loiter_direction in update_loiter
12 years ago
Andrew Tridgell
cf5d102912
AP_Common: added board ID for PX4
12 years ago
Andrew Tridgell
456e8bfb6e
AP_Common: include stdlib.h for abs()
12 years ago
Andrew Tridgell
ac8fcd5b23
AP_Common: include stdbool.h for ARM
12 years ago
Andrew Tridgell
3c0440b0b4
Math: use common degrees() and radians() functions
12 years ago
Pat Hickey
5c738810e2
AP_Progmem created: progmem macros per specific platform
...
* derived from AP_Common
12 years ago
Pat Hickey
0d342a3293
AP_Common: use EXCLUDECORE macro to hack some debug messages away
12 years ago
Pat Hickey
3f1d9d7f69
AP_Param: #include <AP_Param.h> fixups for libraries & sketches
...
* I mostly went through with grep and added an #include <AP_Param.h> below
every #include <AP_Common.h>. Not all of these example sketches might
strictly need AP_Param.
12 years ago