diff --git a/MaximSDK/New_Project/.vscode/workaround.h b/MaximSDK/New_Project/.vscode/workaround.h deleted file mode 100644 index 27e939d..0000000 --- a/MaximSDK/New_Project/.vscode/workaround.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -This is a workaround to VS Code's unresolved issues defining platform-specific symbols -even when the compiler is specified. By force-including -this file we can get the intellisense engine to stop including -non-existent system header files. - -https://github.com/microsoft/vscode-cpptools/issues/1083 -https://github.com/microsoft/vscode-cpptools/issues/4653 - - -*/ - -#undef _WIN32 -#undef __GNUG__ -#undef __cplusplus -#undef __clang__ -#undef __clang_major__ -#undef __clang_minor__ -#undef __clang_patchlevel__ diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/settings.json b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/settings.json index 326d8e7..a1dcfc7 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/settings.json +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/settings.json @@ -28,11 +28,11 @@ "RV_OCD_target_file":"${config:target}_riscv.cfg", "v_Arm_GCC":"10.3", - "v_xPack_GCC":"10.2.0-1.2", + "v_xPack_GCC":"12.2.0-3.1", "OCD_path":"${config:MAXIM_PATH}/Tools/OpenOCD", "ARM_GCC_path":"${config:MAXIM_PATH}/Tools/GNUTools/${config:v_Arm_GCC}", - "xPack_GCC_path":"${config:MAXIM_PATH}/Tools/xPack/riscv-none-embed-gcc/${config:v_xPack_GCC}", + "xPack_GCC_path":"${config:MAXIM_PATH}/Tools/xPack/riscv-none-elf-gcc/${config:v_xPack_GCC}", "Make_path":"${config:MAXIM_PATH}/Tools/MSYS2/usr/bin", "C_Cpp.default.includePath": [ @@ -67,9 +67,9 @@ "${config:MAXIM_PATH}/Libraries/MiscDrivers" ], "C_Cpp.default.defines": [ - "${config:board}", - "TARGET=${config:target}", - "TARGET_REV=0x4131", - "__GNUC__" + + ], + "C_Cpp.default.forcedInclude": [ + "${workspaceFolder}/build/project_defines.h" ] } diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/tasks.json b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/tasks.json index 23f0004..e95445e 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/tasks.json +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/.vscode/tasks.json @@ -5,6 +5,9 @@ "label": "build", "type": "shell", "command": "make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, @@ -12,6 +15,9 @@ "label": "clean", "type": "shell", "command": "make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, @@ -19,6 +25,9 @@ "label": "clean-periph", "type": "shell", "command": "make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/Makefile b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/Makefile index 5f3c4de..4a18b1f 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/Makefile +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/Inject/Makefile @@ -101,8 +101,10 @@ endif # the variables below. -include ./project.mk +PROJECTMK ?= $(abspath ./project.mk) +include $(PROJECTMK) $(info Loaded project.mk) +# PROJECTMK is also used by implicit rules and other libraries to add project.mk as a watch file # ******************************************************************************* # Final path sanitization and re-calculation. No options here. @@ -175,8 +177,9 @@ IPATH := $(IPATH) AUTOSEARCH ?= 1 ifeq ($(AUTOSEARCH), 1) -# Auto-detect all C source files on VPATH +# Auto-detect all C/C++ source files on VPATH SRCS += $(wildcard $(addsuffix /*.c, $(VPATH))) +SRCS += $(wildcard $(addsuffix /*.cpp, $(VPATH))) endif # Collapse SRCS before passing them on to the next stage @@ -248,22 +251,6 @@ MFLOAT_ABI ?= softfp # MFLOAT_ABI must be exported to other Makefiles export MFLOAT_ABI -ifeq "$(RISCV_CORE)" "" -# Default linkerfile is only specified for standard Arm-core projects. -# Otherwise, gcc_riscv.mk sets the appropriate riscv linkerfile. -LINKERFILE ?= $(TARGET_LC).ld -LINKERPATH ?= $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC - -# Check if linkerfile exists -ifeq ("$(wildcard $(LINKERPATH)/$(LINKERFILE))","") -# Doesn't exists, attempt to use root project folder. -LINKERPATH:=. -endif - -# Form full path to linkerfile. Works around MSYS2 edge case from (see MSDK-903). -LINKERFILE:=$(LINKERPATH)/$(LINKERFILE) -endif - # This path contains system-level intialization files for the target micro. Add to the build. VPATH += $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/settings.json b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/settings.json index 326d8e7..a1dcfc7 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/settings.json +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/settings.json @@ -28,11 +28,11 @@ "RV_OCD_target_file":"${config:target}_riscv.cfg", "v_Arm_GCC":"10.3", - "v_xPack_GCC":"10.2.0-1.2", + "v_xPack_GCC":"12.2.0-3.1", "OCD_path":"${config:MAXIM_PATH}/Tools/OpenOCD", "ARM_GCC_path":"${config:MAXIM_PATH}/Tools/GNUTools/${config:v_Arm_GCC}", - "xPack_GCC_path":"${config:MAXIM_PATH}/Tools/xPack/riscv-none-embed-gcc/${config:v_xPack_GCC}", + "xPack_GCC_path":"${config:MAXIM_PATH}/Tools/xPack/riscv-none-elf-gcc/${config:v_xPack_GCC}", "Make_path":"${config:MAXIM_PATH}/Tools/MSYS2/usr/bin", "C_Cpp.default.includePath": [ @@ -67,9 +67,9 @@ "${config:MAXIM_PATH}/Libraries/MiscDrivers" ], "C_Cpp.default.defines": [ - "${config:board}", - "TARGET=${config:target}", - "TARGET_REV=0x4131", - "__GNUC__" + + ], + "C_Cpp.default.forcedInclude": [ + "${workspaceFolder}/build/project_defines.h" ] } diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/tasks.json b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/tasks.json index 23f0004..e95445e 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/tasks.json +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/.vscode/tasks.json @@ -5,6 +5,9 @@ "label": "build", "type": "shell", "command": "make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -r -j 8 --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, @@ -12,6 +15,9 @@ "label": "clean", "type": "shell", "command": "make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 clean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, @@ -19,6 +25,9 @@ "label": "clean-periph", "type": "shell", "command": "make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}", + "osx":{ + "command": "source ~/.zshrc && make -j 8 distclean --output-sync=target --no-print-directory TARGET=${config:target} BOARD=${config:board} MAXIM_PATH=${config:MAXIM_PATH} MAKE=make PROJECT=${config:project_name}" + }, "group": "build", "problemMatcher": [] }, diff --git a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/Makefile b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/Makefile index 5f3c4de..4a18b1f 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/Makefile +++ b/installer/com.maximintegrated.dist.vscodemaxim/data/Tools/VSCode-Maxim/New_Project/Makefile @@ -101,8 +101,10 @@ endif # the variables below. -include ./project.mk +PROJECTMK ?= $(abspath ./project.mk) +include $(PROJECTMK) $(info Loaded project.mk) +# PROJECTMK is also used by implicit rules and other libraries to add project.mk as a watch file # ******************************************************************************* # Final path sanitization and re-calculation. No options here. @@ -175,8 +177,9 @@ IPATH := $(IPATH) AUTOSEARCH ?= 1 ifeq ($(AUTOSEARCH), 1) -# Auto-detect all C source files on VPATH +# Auto-detect all C/C++ source files on VPATH SRCS += $(wildcard $(addsuffix /*.c, $(VPATH))) +SRCS += $(wildcard $(addsuffix /*.cpp, $(VPATH))) endif # Collapse SRCS before passing them on to the next stage @@ -248,22 +251,6 @@ MFLOAT_ABI ?= softfp # MFLOAT_ABI must be exported to other Makefiles export MFLOAT_ABI -ifeq "$(RISCV_CORE)" "" -# Default linkerfile is only specified for standard Arm-core projects. -# Otherwise, gcc_riscv.mk sets the appropriate riscv linkerfile. -LINKERFILE ?= $(TARGET_LC).ld -LINKERPATH ?= $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source/GCC - -# Check if linkerfile exists -ifeq ("$(wildcard $(LINKERPATH)/$(LINKERFILE))","") -# Doesn't exists, attempt to use root project folder. -LINKERPATH:=. -endif - -# Form full path to linkerfile. Works around MSYS2 edge case from (see MSDK-903). -LINKERFILE:=$(LINKERPATH)/$(LINKERFILE) -endif - # This path contains system-level intialization files for the target micro. Add to the build. VPATH += $(CMSIS_ROOT)/Device/Maxim/$(TARGET_UC)/Source diff --git a/installer/com.maximintegrated.dist.vscodemaxim/meta/package.xml b/installer/com.maximintegrated.dist.vscodemaxim/meta/package.xml index d0b34fe..99c90a7 100644 --- a/installer/com.maximintegrated.dist.vscodemaxim/meta/package.xml +++ b/installer/com.maximintegrated.dist.vscodemaxim/meta/package.xml @@ -1,9 +1,10 @@ Visual Studio Code Support Project files, templates, and documentation for integrating Visual Studio Code and the MaximSDK. Example projects come pre-populated with .vscode project folders, and this package contains information on how to use them. It installs to "Tools/VSCode-Maxim". - 2023-03-27 + 2023-06-29 net.sourceforge.openocd, net.launchpad.gcc.arm.embedded, net.launchpad.gcc.riscv.embedded, com.maximintegrated.libraries.periphdrivers - 1.6.0 + 1.6.1 1 + true \ No newline at end of file