Skip to content

Commit ea9faf8

Browse files
committed
2 parents 8159b67 + ff40983 commit ea9faf8

4 files changed

Lines changed: 31 additions & 25 deletions

File tree

platform.txt

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,13 @@ build.flash_offset=0
9999

100100
# Pre and post build hooks
101101
build.opt.name=build_opt.h
102-
build.opt.sourcepath={build.source.path}/{build.opt.name}
103102
build.opt.path={build.path}/sketch/{build.opt.name}
104103

105-
build.src_wrapper.path={build.path}/sketch/SrcWrapper.cpp
104+
extras.path={build.system.path}/extras
106105

107-
# Create sketch dir if not exists
108-
recipe.hooks.prebuild.1.pattern.windows=cmd /c if not exist "{build.path}\sketch" mkdir "{build.path}\sketch"
109-
recipe.hooks.prebuild.1.pattern.linux=bash -c "[ -f {build.path}/sketch ] || mkdir -p {build.path}/sketch"
110-
recipe.hooks.prebuild.1.pattern.macosx=bash -c "[ -f {build.path}/sketch ] || mkdir -p {build.path}/sketch"
111-
112-
# Create empty {build.opt} if not exists in the sketch dir
113-
recipe.hooks.prebuild.2.pattern.windows=cmd /c if not exist "{build.opt.sourcepath}" type NUL > "{build.opt.path}"
114-
recipe.hooks.prebuild.2.pattern.linux=bash -c "[ -f {build.opt.sourcepath} ] || touch {build.opt.path}"
115-
recipe.hooks.prebuild.2.pattern.macosx=bash -c "[ -f {build.opt.sourcepath} ] || touch {build.opt.path}"
116-
117-
# Force include of SrcWrapper library
118-
recipe.hooks.prebuild.3.pattern.windows=cmd /c echo #include ^<SrcWrapper.h^> > "{build.src_wrapper.path}"
119-
recipe.hooks.prebuild.3.pattern.linux=bash -c "echo $0 > {build.src_wrapper.path}" "#include <SrcWrapper.h>"
120-
recipe.hooks.prebuild.3.pattern.macosx=bash -c "echo $0 > {build.src_wrapper.path}" "#include <SrcWrapper.h>"
106+
# Create empty {build.opt} if not exists in the output sketch dir and force include of SrcWrapper library
107+
recipe.hooks.prebuild.1.pattern="{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}"
108+
recipe.hooks.prebuild.1.pattern.windows="{runtime.tools.STM32Tools.path}/tools/win/busybox.exe" sh "{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}"
121109

122110
# compile patterns
123111
# ---------------------
@@ -162,9 +150,8 @@ recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
162150
# -------------------
163151

164152
# Upload to board via mass storage
165-
tools.massStorageCopy.cmd=massStorageCopy
153+
tools.massStorageCopy.cmd=massStorageCopy.sh
166154
tools.massStorageCopy.cmd.windows=massStorageCopy.bat
167-
tools.massStorageCopy.cmd.macosx=massStorageCopyMacOsX
168155
tools.massStorageCopy.path={runtime.tools.STM32Tools.path}/tools/win
169156
tools.massStorageCopy.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
170157
tools.massStorageCopy.path.linux={runtime.tools.STM32Tools.path}/tools/linux
@@ -174,7 +161,6 @@ tools.massStorageCopy.upload.pattern="{path}/{cmd}" {upload.verbose} -I "{build.
174161

175162
# STM32CubeProgrammer upload
176163
tools.stm32CubeProg.cmd=stm32CubeProg.sh
177-
tools.stm32CubeProg.cmd.macosx=stm32CubeProg
178164
tools.stm32CubeProg.cmd.windows=stm32CubeProg.bat
179165
tools.stm32CubeProg.path.linux={runtime.tools.STM32Tools.path}/tools/linux
180166
tools.stm32CubeProg.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
@@ -202,7 +188,7 @@ tools.hid_upload.upload.params.quiet=n
202188
tools.hid_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}
203189

204190
# Upload using Maple bootloader over DFU
205-
tools.maple_upload.cmd=maple_upload
191+
tools.maple_upload.cmd=maple_upload.sh
206192
tools.maple_upload.cmd.windows=maple_upload.bat
207193
tools.maple_upload.path={runtime.tools.STM32Tools.path}/tools/win
208194
tools.maple_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx

system/extras/prebuild.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
BUILD_PATH="$1"
4+
BUILD_SOURCE_PATH="$2"
5+
6+
# Create sketch dir if not exists
7+
if [ ! -f "$BUILD_PATH/sketch" ]; then
8+
mkdir -p "$BUILD_PATH/sketch"
9+
fi
10+
11+
# Create empty build.opt.h if not exists in the original sketch dir
12+
if [ ! -f "$BUILD_SOURCE_PATH/build_opt.h" ]; then
13+
touch "$BUILD_PATH/sketch/build_opt.h"
14+
fi
15+
16+
# Force include of SrcWrapper library
17+
echo "#include <SrcWrapper.h>" >"$BUILD_PATH/sketch/SrcWrapper.cpp"

variants/Generic_F411Cx/variant.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ extern "C" {
8181
#define LED_GREEN LED_BUILTIN
8282

8383
// On-board user button
84-
#if !defined(USER_BTN) && !defined(ARDUINO_BLACKPILL_F411CE)
84+
#ifdef ARDUINO_BLACKPILL_F411CE
85+
#define USER_BTN PA0
86+
#endif
87+
#if !defined(USER_BTN)
8588
#define USER_BTN PC13
8689
#endif
8790

variants/NUCLEO_F767ZI/variant.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ extern "C" {
3737
#define PF13 7
3838
#define PF12 8
3939
#define PD15 9
40-
#define PD14 A10
41-
#define PA7 A11
42-
#define PA6 A12
43-
#define PA5 13
40+
#define PD14 10
41+
#define PA7 A10
42+
#define PA6 A11
43+
#define PA5 A12
4444
#define PB9 14
4545
#define PB8 15
4646
#define PC6 16

0 commit comments

Comments
 (0)