@@ -99,25 +99,13 @@ build.flash_offset=0
9999
100100# Pre and post build hooks
101101build.opt.name=build_opt.h
102- build.opt.sourcepath={build.source.path}/{build.opt.name}
103102build.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
166154tools.massStorageCopy.cmd.windows=massStorageCopy.bat
167- tools.massStorageCopy.cmd.macosx=massStorageCopyMacOsX
168155tools.massStorageCopy.path={runtime.tools.STM32Tools.path}/tools/win
169156tools.massStorageCopy.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
170157tools.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
176163tools.stm32CubeProg.cmd=stm32CubeProg.sh
177- tools.stm32CubeProg.cmd.macosx=stm32CubeProg
178164tools.stm32CubeProg.cmd.windows=stm32CubeProg.bat
179165tools.stm32CubeProg.path.linux={runtime.tools.STM32Tools.path}/tools/linux
180166tools.stm32CubeProg.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
@@ -202,7 +188,7 @@ tools.hid_upload.upload.params.quiet=n
202188tools.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
206192tools.maple_upload.cmd.windows=maple_upload.bat
207193tools.maple_upload.path={runtime.tools.STM32Tools.path}/tools/win
208194tools.maple_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
0 commit comments