1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00
inav/lib/main
Marcelo Bezerra 69bd3e9d93
[SITL OSX] Fix some of the warnings and add macosx SITL build to workflows (#9063)
clang can be verbose with warnings, but some of it is probably valid when building a 64bit binary.

Highlighted changes:

* Call float versions of math functions to avoid conversion to double by the compiler (absf, sqrtf, roundf, etc)
* Make sure floating point constants are marked as floats, to avoid conversion to double by the compiler. (1.0 is a double, 1.0f is a float and when doing math between float and double, all values get upgraded to double!)
* Changed memcpy_fn in unit test AND SITL builds to be a macro to memcpy (instead of inline function calling memcpy), this fixes linker errors for memcpy as macos compiler mangles the symbol in a different way and would not work with asm("memcpy") call.
* Some simulator code made heavy use of doubles, but since all the data in INAV is float, that is probably overkill and some functions/macros had float in the name, while upconvertting to double.

Open questions:

* Should scale in osdFormatCentiNumber be changed to float? It is currently uint32_t but some of the scale defines are, correctly, not integer numbers.
* I changed CENTIDEGREES_TO_DEGREES to use float on the division path, but the code seems to be ok, or assuming it would be converted to integer anyway. Is this the correct solution?
* This still does not fix the invalid settings issues, I suspect it is related to the lack of linker scripts in clang, to preserve the section data of settings.
* Binary is still not multi platform (arm/x86_64).
2023-05-25 13:12:03 +02:00
..
AT32F43x add at32 bsp driver lib 2023-02-13 00:49:29 +08:00
CMSIS Cleanup build system and unused source files (#3047) 2018-04-25 10:01:00 +10:00
MAVLink [SITL OSX] Fix some of the warnings and add macosx SITL build to workflows (#9063) 2023-05-25 13:12:03 +02:00
STM32_USB-FS-Device_Driver Further improvements in serial const correctness 2016-10-04 09:03:38 +01:00
STM32_USB_Device_Library Cleanup build system and unused source files (#3047) 2018-04-25 10:01:00 +10:00
STM32_USB_OTG_Driver cleanup a pointless use of __packed (gcc 8.2 warning) 2018-07-27 17:54:32 +01:00
STM32F4 Cleanup build system and unused source files (#3047) 2018-04-25 10:01:00 +10:00
STM32F7 minor gcc 8.2 cleanup for unnecessary use of packed in f7 USB driver 2018-08-08 17:40:24 +01:00
STM32H7 stm32 LL library: fix pre-compiler warning 2021-12-23 17:57:50 +01:00