Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita147d5e

Browse files
committed
Added recipe.hooks feature to override gcc options
It is now possible to customize some core definitionsor gcc options thanks a file named "build_opt.h"in the sketch directory. (using@file gcc option)Example of file content to change F_CPU value:-UF_CPU -DF_CPU=72000000ULIf the file does not exist an empty one is created.Fix#41Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent7d1bafb commita147d5e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎platform.txt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ compiler.c.elf.cmd=arm-none-eabi-gcc
2929
compiler.objcopy.cmd=arm-none-eabi-objcopy
3030
compiler.elf2hex.cmd=arm-none-eabi-objcopy
3131

32-
compiler.extra_flags=-mcpu={build.mcu} -DF_CPU={build.f_cpu} -mthumb
32+
compiler.extra_flags=-mcpu={build.mcu} -DF_CPU={build.f_cpu} -mthumb @{build.path}/sketch/build_opt.h
3333

3434
compiler.S.flags={compiler.extra_flags} -c -x assembler-with-cpp {compiler.stm.extra_include}
3535

@@ -77,6 +77,11 @@ build.enable_usb=
7777
build.flags.optimize=
7878
build.flags.ldspecs=
7979

80+
# Pre and post build hooks
81+
recipe.hooks.prebuild.1.pattern.windows=cmd /c "if not exist {build.source.path}\build_opt.h mkdir {build.path}\sketch & type NUL > {build.path}\sketch\build_opt.h"
82+
recipe.hooks.prebuild.1.pattern.linux=bash -c "[ -f {build.source.path}/build_opt.h ] || (mkdir -p {build.path}/sketch && touch {build.path}/sketch/build_opt.h)"
83+
recipe.hooks.prebuild.1.pattern.macosx=bash -c "[ -f {build.source.path}/build_opt.h ] || (mkdir -p {build.path}/sketch && touch {build.path}/sketch/build_opt.h)"
84+
8085
# compile patterns
8186
# ---------------------
8287

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp