Skip to content

Commit 1716956

Browse files
cmake: Fix compilation flag for speed
Change the optimisation flag for speed from o2 to o3 (o3 needs licensed version of toolchain) Signed-off-by: Muhammed Zamroodh <[email protected]>
1 parent 4afe766 commit 1716956

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

boards/microchip/dspic33/dspic33a_curiosity/board.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#include <zephyr/init.h>
77
#include <zephyr/kernel.h>
88

9-
/* Board level init for dspic33a_curiosity
10-
*/
119
void board_early_init_hook(void)
1210
{
11+
/* Intentionally empty: This system dosent use Board level init.
12+
* Board level init for dspic33a_curiosity
13+
*/
1314
}

boards/microchip/dspic33/dspic33a_curiosity/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ The XC-DSC toolchain hooks its optimization levels in
137137
``cmake/compiler/xcdsc/compiler_flags.cmake`` by mapping Zephyr's generic
138138
properties to concrete compiler flags. In this file:
139139

140-
* ``optimization_speed`` uses ``-O2``.
140+
* ``optimization_speed`` uses ``-O3``.
141141
* ``optimization_size`` uses ``-O2``.
142142
* ``optimization_size_aggressive`` uses ``-Os``.
143143
* ``optimization_debug`` uses ``-O1``.
@@ -155,7 +155,7 @@ To change that default, set one of these options in your application's
155155
- ``CONFIG_SIZE_OPTIMIZATIONS_AGGRESSIVE`` switches to ``optimization_size_aggressive``,
156156
which adds the ``-Os`` mapping described in ``compiler_flags.cmake``. This
157157
level is only available when your XC-DSC compiler is licensed.
158-
- ``CONFIG_SPEED_OPTIMIZATIONS`` selects ``optimization_speed`` (``-O2``).
158+
- ``CONFIG_SPEED_OPTIMIZATIONS`` selects ``optimization_speed`` (``-O3``).
159159
- ``CONFIG_DEBUG_OPTIMIZATIONS`` selects ``optimization_debug`` (``-O1``).
160160
- ``CONFIG_NO_OPTIMIZATIONS`` forces (``-O0``).
161161

cmake/compiler/xcdsc/compiler_flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set_compiler_property(PROPERTY debug -g)
33
# Optimization for debug builds
44
set_compiler_property(PROPERTY optimization_debug -O1)
5-
set_compiler_property(PROPERTY optimization_speed -O2)
5+
set_compiler_property(PROPERTY optimization_speed -O3)
66
# Optimize for size
77
set_compiler_property(PROPERTY optimization_size -O2)
88
set_compiler_property(PROPERTY optimization_size_aggressive -Os)

soc/microchip/dspic33/dspic33a/soc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#include <zephyr/device.h>
77
#include <zephyr/init.h>
88

9-
/* SOC level init for dspic33a family of chips
10-
*/
119
void soc_early_init_hook(void)
1210
{
11+
/* Intentionally empty: This system dosent use SOC level init.
12+
* SOC level init for dspic33a family of chips
13+
*/
1314
}

0 commit comments

Comments
 (0)