selectively increase optimization -Os -> -O2

- targetted at modules/libraries that benefit without drastically
increasing flash usage
 - ignored on boards with CONSTRAINED_FLASH set
This commit is contained in:
Daniel Agar
2020-06-04 20:59:52 -04:00
parent 7f73b9a131
commit 31fe7af454
26 changed files with 71 additions and 34 deletions
@@ -65,7 +65,7 @@ static constexpr wq_config_t I2C3{"wq:I2C3", 1472, -11};
static constexpr wq_config_t I2C4{"wq:I2C4", 1472, -12};
// PX4 att/pos controllers, highest priority after sensors.
static constexpr wq_config_t attitude_ctrl{"wq:attitude_ctrl", 1536, -13};
static constexpr wq_config_t attitude_ctrl{"wq:attitude_ctrl", 1600, -13};
static constexpr wq_config_t navigation_and_controllers{"wq:navigation_and_controllers", 7200, -14};
static constexpr wq_config_t hp_default{"wq:hp_default", 1900, -15};
@@ -43,4 +43,5 @@ if(PX4_TESTING)
add_subdirectory(test)
endif()
target_compile_options(px4_work_queue PRIVATE ${MAX_CUSTOM_OPT_LEVEL})
target_link_libraries(px4_work_queue PRIVATE px4_platform)
@@ -32,7 +32,7 @@
############################################################################
# skip for px4_layer support on an IO board
if (NOT ${PX4_BOARD} MATCHES "px4_io")
if(NOT PX4_BOARD MATCHES "px4_io")
add_library(px4_layer
board_crashdump.c
@@ -34,3 +34,4 @@
px4_add_library(arch_dshot
dshot.c
)
target_compile_options(arch_dshot PRIVATE ${MAX_CUSTOM_OPT_LEVEL})
@@ -34,5 +34,8 @@
px4_add_library(arch_hrt
hrt.c
)
target_compile_options(arch_hrt PRIVATE -Wno-cast-align) # TODO: fix and enable
target_compile_options(arch_hrt
PRIVATE
${MAX_CUSTOM_OPT_LEVEL}
-Wno-cast-align # TODO: fix and enable
)
@@ -32,8 +32,9 @@
############################################################################
px4_add_library(arch_io_pins
input_capture.c
io_timer.c
pwm_servo.c
pwm_trigger.c
input_capture.c
)
target_compile_options(arch_io_pins PRIVATE ${MAX_CUSTOM_OPT_LEVEL})
@@ -34,3 +34,4 @@
px4_add_library(arch_spi
spi.cpp
)
target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL})