diff --git a/avr/libraries/Kaleidoscope b/avr/libraries/Kaleidoscope index 157f013..12876f9 160000 --- a/avr/libraries/Kaleidoscope +++ b/avr/libraries/Kaleidoscope @@ -1 +1 @@ -Subproject commit 157f0133a78eab8ee899257d6b6eb3c3a869f006 +Subproject commit 12876f9a90cff44e3be651bff2e58c32450360cd diff --git a/avr/platform.txt b/avr/platform.txt index c97013a..2b26493 100644 --- a/avr/platform.txt +++ b/avr/platform.txt @@ -188,3 +188,16 @@ tools.ctags.path={runtime.tools.ctags.path} tools.ctags.cmd.path={path}/ctags tools.ctags.pattern="{cmd.path}" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "{source_file}" +# The following recipes enable adding code to specific places +# of the preprocessed firmware sketch. This is done by pasting +# the content of two files +# kaleidoscope_internal/sketch_preprocessing/sketch_header.h, +# kaleidoscope_internal/sketch_preprocessing/sketch_footer.h +# to the top and the bottom of the preprocessed sketch file. + +recipe.hooks.sketch.prebuild.1.pattern=mv "{build.path}/sketch/{build.project_name}.cpp" "{build.path}/sketch/{build.project_name}.cpp.bak" +recipe.hooks.sketch.prebuild.2.pattern=sh -c "cat {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_header.h {build.path}/sketch/{build.project_name}.cpp.bak {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_footer.h > {build.path}/sketch/{build.project_name}.cpp" + +recipe.hooks.sketch.prebuild.1.pattern.windows={tools.rm_start.cmd} "{build.path}/sketch/{build.project_name}.cpp.bak" {tools.rm_end.cmd} +recipe.hooks.sketch.prebuild.2.pattern.windows=powershell.exe mv "{build.path}/sketch/{build.project_name}.cpp" "{build.path}/sketch/{build.project_name}.cpp.bak" +recipe.hooks.sketch.prebuild.3.pattern.windows=powershell.exe -command "& {&cat {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_header.h, {build.path}/sketch/{build.project_name}.cpp.bak, {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_footer.h | sc {build.path}/sketch/{build.project_name}.cpp}" diff --git a/virtual/platform.txt b/virtual/platform.txt index 01f20bc..7f1bedf 100644 --- a/virtual/platform.txt +++ b/virtual/platform.txt @@ -168,3 +168,17 @@ tools.rm_end.cmd.windows= ; exit 0 # - from numeric vendor ID, set to Unknown otherwise build.usb_manufacturer="Unknown" build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' + +# The following recipes enable adding code to specific places +# of the preprocessed firmware sketch. This is done by pasting +# the content of two files +# kaleidoscope_internal/sketch_preprocessing/sketch_header.h, +# kaleidoscope_internal/sketch_preprocessing/sketch_footer.h +# to the top and the bottom of the preprocessed sketch file. + +recipe.hooks.sketch.prebuild.1.pattern=mv "{build.path}/sketch/{build.project_name}.cpp" "{build.path}/sketch/{build.project_name}.cpp.bak" +recipe.hooks.sketch.prebuild.2.pattern=sh -c "cat {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_header.h {build.path}/sketch/{build.project_name}.cpp.bak {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_footer.h > {build.path}/sketch/{build.project_name}.cpp" + +recipe.hooks.sketch.prebuild.1.pattern.windows={tools.rm_start.cmd} "{build.path}/sketch/{build.project_name}.cpp.bak" {tools.rm_end.cmd} +recipe.hooks.sketch.prebuild.2.pattern.windows=powershell.exe mv "{build.path}/sketch/{build.project_name}.cpp" "{build.path}/sketch/{build.project_name}.cpp.bak" +recipe.hooks.sketch.prebuild.3.pattern.windows=powershell.exe -command "& {&cat {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_header.h, {build.path}/sketch/{build.project_name}.cpp.bak, {runtime.platform.path}/libraries/Kaleidoscope/src/kaleidoscope_internal/sketch_preprocessing/sketch_footer.h | sc {build.path}/sketch/{build.project_name}.cpp}"