Skip to content

Commit

Permalink
STM32Cube Java Path on MacOS Incorrectly (#252)
Browse files Browse the repository at this point in the history
* Update Java path for each platform

* Remove testing logs

* Update if check for mac and else for windows/linux

* Simplify if statement

* Remove -s flag

* Update .gitignore to ignore Python venv paths

* Refactor cubemx and java paths

* Refactor cubemx and java paths

* Refactor cubemx and java paths

* Update .gitignore paths
  • Loading branch information
CameronBeneteau authored Oct 27, 2024
1 parent 9fa39bc commit 9144a9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.DS_STORE
.vscode
.vscode

**/env
**/venv
**/.env
**/.venv
15 changes: 12 additions & 3 deletions firmware/cmake/generate_cubemx.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
ifeq ($(OS),Windows_NT)
# Convert windows backslash to regular slash
# Find the STM32CubeMX executable
ifeq ($(OS), Windows_NT)
# Convert Windows backslash to regular slash
CUBEMX_PATH := $(subst \,/,$(shell where STM32CubeMX))
else # Linux / MacOS
CUBEMX_PATH := $(shell which STM32CubeMX)
endif

# Find the JAVA which is installed with CubeMX. Spaces in path are escaped.
space := $(subst ,, )
CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/bin/java

ifeq ($(shell uname), Darwin)
# MacOS
CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/Contents/Home/bin/java
else
# Windows / Linux
CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/bin/java
endif

# Known bug: Expanding CUBEMX_JAVA twice does not work.

IOC_FILE = board_config.ioc
Expand Down

0 comments on commit 9144a9c

Please sign in to comment.