Browse Source

added template folder

master
Martin Vladic 2 years ago
parent
commit
258d705c3f
  1. 6
      .cproject
  2. 2
      .project
  3. 4
      Src/firmware.cpp
  4. 6
      Src/gui/hooks.cpp
  5. 4
      Src/platform/simulator/emscripten/index.html
  6. 2
      Src/platform/simulator/simulator.eez-project
  7. BIN
      Src/platform/simulator/win32/icon.rc
  8. 4
      eez-flow-template-stm32f469i-disco.ioc
  9. 0
      template/image.png
  10. 3
      template/manifest.json
  11. 52
      template/post.js

6
.cproject

@ -25,7 +25,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1428482885" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="STM32F469I-DISCO" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.992922296" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F469I-DISCO || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../FATFS/App | ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F | ../Drivers/CMSIS/Include | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Core/Inc | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../FATFS/Target | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Middlewares/Third_Party/FatFs/src | ../USB_DEVICE/App | ../USB_DEVICE/Target | ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc | ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc || || || USE_HAL_DRIVER | STM32F469xx || || Drivers | Core/Startup | Middlewares | Core | FATFS | USB_DEVICE || || || ${workspace_loc:/${ProjName}/STM32F469NIHX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.940103679" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/eez-flow-template-stm32f469i-disco}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1381519550" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<builder buildPath="${workspace_loc:/{{projectName}}}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1381519550" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1508774904" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.420577669" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.2090615990" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
@ -220,7 +220,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1017528934" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="STM32F469I-DISCO" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.632082707" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32F469I-DISCO || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../FATFS/App | ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F | ../Drivers/CMSIS/Include | ../Drivers/STM32F4xx_HAL_Driver/Inc | ../Core/Inc | ../Drivers/CMSIS/Device/ST/STM32F4xx/Include | ../FATFS/Target | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 | ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy | ../Middlewares/Third_Party/FatFs/src | ../USB_DEVICE/App | ../USB_DEVICE/Target | ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc | ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc || || || USE_HAL_DRIVER | STM32F469xx || || Drivers | Core/Startup | Middlewares | Core | FATFS | USB_DEVICE || || || ${workspace_loc:/${ProjName}/STM32F469NIHX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1663973541" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/eez-flow-template-stm32f469i-disco}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1906799016" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<builder buildPath="${workspace_loc:/{{projectName}}}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1906799016" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1798704718" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1965537707" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1929343366" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
@ -310,7 +310,7 @@
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="eez-flow-template-stm32f469i-disco.null.560981908" name="eez-flow-template-stm32f469i-disco"/>
<project id="{{projectName}}.null.560981908" name="{{projectName}}"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="scannerConfiguration">

2
.project

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>eez-flow-template-stm32f469i-disco</name>
<name>{{projectName}}</name>
<comment></comment>
<projects>
</projects>

4
Src/firmware.cpp

@ -79,8 +79,8 @@ EM_PORT_API(void) startFlow() {
// clang-format off
void mountFileSystem() {
EM_ASM(
FS.mkdir("/eez-flow-template-stm32f469i-disco");
FS.mount(IDBFS, {}, "/eez-flow-template-stm32f469i-disco");
FS.mkdir("/{{projectName}}");
FS.mount(IDBFS, {}, "/{{projectName}}");
//Module.print("start file sync..");

6
Src/gui/hooks.cpp

@ -45,12 +45,12 @@ char *getConfFilePath(const char *file_name) {
#ifdef _WIN32
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, file_path))) {
stringAppendString(file_path, sizeof(file_path), "\\.eez-flow-template-stm32f469i-disco");
stringAppendString(file_path, sizeof(file_path), "\\.{{projectName}}");
_mkdir(file_path);
stringAppendString(file_path, sizeof(file_path), "\\");
}
#elif defined(__EMSCRIPTEN__)
stringAppendString(file_path, sizeof(file_path), "/eez-flow-template-stm32f469i-disco/");
stringAppendString(file_path, sizeof(file_path), "/{{projectName}}/");
#else
const char *home_dir = 0;
if ((home_dir = getenv("HOME")) == NULL) {
@ -58,7 +58,7 @@ char *getConfFilePath(const char *file_name) {
}
if (home_dir) {
stringAppendString(file_path, sizeof(file_path), home_dir);
stringAppendString(file_path, sizeof(file_path), "/.eez-flow-template-stm32f469i-disco");
stringAppendString(file_path, sizeof(file_path), "/.{{projectName}}");
mkdir(file_path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
stringAppendString(file_path, sizeof(file_path), "/");
}

4
Src/platform/simulator/emscripten/index.html

@ -20,7 +20,7 @@
<body>
<div id="content">
<div id="header">
<div id='title'>STM32F469I-DISCO Template</div>
<div id='title'>{{projectName}}</div>
<div id='spinner'></div>
<div id="status">Downloading...</div>
<div>
@ -41,7 +41,7 @@
</div>
<script src="main.js"></script>
<script async type="text/javascript" src="eez-flow-template-stm32f469i-disco.js"></script>
<script async type="text/javascript" src="{{projectName}}.js"></script>
</body>
</html>

2
Src/platform/simulator/simulator.eez-project

@ -6,7 +6,7 @@
"namespace": "",
"imports": [
{
"projectFilePath": "..\\..\\eez-flow-template-stm32f469i-disco-gui.eez-project"
"projectFilePath": "..\\..\\{{projectName}}-gui.eez-project"
}
],
"flowSupport": true,

BIN
Src/platform/simulator/win32/icon.rc

Binary file not shown.

4
eez-flow-template-stm32f469i-disco.ioc

@ -1035,8 +1035,8 @@ ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=eez-flow-template-stm32f469i-disco.ioc
ProjectManager.ProjectName=eez-flow-template-stm32f469i-disco
ProjectManager.ProjectFileName={{projectName}}.ioc
ProjectManager.ProjectName={{projectName}}
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE

0
image.png → template/image.png

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 326 KiB

3
template/manifest.json

@ -0,0 +1,3 @@
{
"eez-project-path": "Src/{{projectName}}.eez-project"
}

52
template/post.js

@ -0,0 +1,52 @@
/**
* @callback RenameFile
* @param {string} fileSrcRelativePath
* @param {string} fileDstRelativePath
* @returns {Promise<void>}
*/
/**
* @callback ReplaceInFile
* @param {string} fileRelativePath
* @param {string} searchValue
* @param {string} newValue
* @returns {Promise<void>}
*/
/**
* @typedef {Object} WizardContext
* @property {string} projectDirPath
* @property {string} projectName
* @property {RenameFile} renameFile
* @property {ReplaceInFile} replaceInFile
*/
/**
* @param {WizardContext} context
*/
async function postProcessing(context) {
await context.replaceInFile(".cproject", "{{projectName}}", context.projectName);
await context.replaceInFile(".project", "{{projectName}}", context.projectName);
await context.renameFile("eez-flow-template-stm32f469i-disco.ioc", context.projectName + ".ioc");
await context.replaceInFile(context.projectName + ".ioc", "{{projectName}}", context.projectName);
await context.renameFile("Src/eez-flow-template-stm32f469i-disco.eez-project", "Src/" + context.projectName + ".eez-project");
await context.renameFile("Src/eez-flow-template-stm32f469i-disco-gui.eez-project", "Src/" + context.projectName + "-gui.eez-project");
await context.replaceInFile("Src/" + context.projectName + ".eez-project", "eez-flow-template-stm32f469i-disco-gui.eez-project", context.projectName + "-gui.eez-project");
await context.replaceInFile("Src/" + context.projectName + "-gui.eez-project", "eez-flow-template-stm32f469i-disco.eez-project", context.projectName + ".eez-project");
await context.replaceInFile("Src/firmware.cpp", "{{projectName}}", context.projectName);
await context.replaceInFile("Src/gui/hooks.cpp", "{{projectName}}", context.projectName);
await context.replaceInFile("Src/platform/simulator/simulator.eez-project", "{{projectName}}", context.projectName);
await context.replaceInFile("Src/platform/simulator/emscripten/index.html", "{{projectName}}", context.projectName);
await context.replaceInFile("Src/platform/simulator/win32/icon.rc", "{{projectName}}", context.projectName);
await context.replaceInFile("template/manifest.json", "{{projectName}}", context.projectName);
}
module.exports = postProcessing;
Loading…
Cancel
Save