Skip to content

Commit 9bae50d

Browse files
committed
Allow use of a custom peripheral pins file
Syntax in the board.txt: xxx.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS Example to use a custom peripheral pins file for Nucleo_L476RG: Nucleo_64.menu.pnum.NUCLEO_L476RG.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS Then add a file with ".c" extension like "PeripheralPins_<board>.c" in the variantfolder. At sketch folder: CUSTOM_PERIPHERAL_PINS could now be overridden using the build_opt.h, ex: -DCUSTOM_PERIPHERAL_PINS=\"PeripheralPins_NUCLEO_L476RG.c\" Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 1a9416a commit 9bae50d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ build.bootloader_flags=
5555
build.ldscript=ldscript.ld
5656

5757
# These can be overridden in platform.local.txt
58-
compiler.c.extra_flags=
58+
compiler.c.extra_flags={build.peripheral_pins}
5959
compiler.c.elf.extra_flags=
6060
compiler.cpp.extra_flags=
6161
compiler.cpp.std=gnu++14
@@ -96,6 +96,7 @@ build.xSerial=-DHAL_UART_MODULE_ENABLED
9696
build.enable_usb=
9797
build.usb_speed=
9898
build.enable_virtio=
99+
build.peripheral_pins=
99100
build.startup_file=
100101
build.flags.fp=
101102
build.flags.optimize=-Os

0 commit comments

Comments
 (0)