Skip to content

Commit

Permalink
Merge branch 'spark' into shane/spark/spark_menu_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 26, 2024
2 parents 64bc716 + c672982 commit 2a69175
Show file tree
Hide file tree
Showing 12 changed files with 577 additions and 175 deletions.
27 changes: 12 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all install build upload clean
.PHONY: all install build upload clean compute_version

ARDUINO_CLI = ./bin/arduino-cli --verbose
BOARD = esp32:esp32:XIAO_ESP32C3
Expand All @@ -10,19 +10,6 @@ CONFIG_FILE = $(HOME)/.arduino15/arduino-cli.yaml
# The branch/tag suffix for this device
BRANCH_SUFFIX=s

# Fetch tags, determine version numbers based on the latest tag, and slice off the branch suffix
VORTEX_VERSION_MAJOR ?= $(shell git fetch --depth=1 origin +refs/tags/*:refs/tags/* &> /dev/null && git tag --list "*$(BRANCH_SUFFIX)" | sort -V | tail -n1 | cut -d. -f1)
VORTEX_VERSION_MINOR ?= $(shell git tag --list "*$(BRANCH_SUFFIX)" | sort -V | tail -n1 | sed 's/$(BRANCH_SUFFIX)$$//' | cut -d. -f2)
VORTEX_BUILD_NUMBER ?= $(shell git rev-list --count HEAD)

# If no tags are found, default to 0.1.0
VORTEX_VERSION_MAJOR := $(if $(VORTEX_VERSION_MAJOR),$(VORTEX_VERSION_MAJOR),0)
VORTEX_VERSION_MINOR := $(if $(VORTEX_VERSION_MINOR),$(VORTEX_VERSION_MINOR),1)
VORTEX_BUILD_NUMBER := $(if $(VORTEX_BUILD_NUMBER),$(VORTEX_BUILD_NUMBER),0)

# Combine into a full version number
VORTEX_VERSION_NUMBER := $(VORTEX_VERSION_MAJOR).$(VORTEX_VERSION_MINOR).$(VORTEX_BUILD_NUMBER)

DEFINES=\
-D VORTEX_VERSION_MAJOR=$(VORTEX_VERSION_MAJOR) \
-D VORTEX_VERSION_MINOR=$(VORTEX_VERSION_MINOR) \
Expand Down Expand Up @@ -50,7 +37,7 @@ install:
$(ARDUINO_CLI) core install esp32:esp32 --config-file $(CONFIG_FILE)
$(ARDUINO_CLI) lib install FastLED

build:
build: compute_version
$(ARDUINO_CLI) compile --fqbn $(BOARD) $(PROJECT_NAME) \
--config-file $(CONFIG_FILE) \
--build-path $(BUILD_PATH) \
Expand All @@ -67,3 +54,13 @@ core-list:
clean:
rm -rf $(BUILD_PATH)

# calculate the version number of the build
compute_version:
$(eval LATEST_TAG ?= $(shell git fetch --depth=1 origin +refs/tags/*:refs/tags/* &> /dev/null && git tag --list "*$(BRANCH_SUFFIX)" | sort -V | tail -n1))
$(eval VORTEX_VERSION_MAJOR ?= $(shell echo $(LATEST_TAG) | cut -d. -f1))
$(eval VORTEX_VERSION_MINOR ?= $(shell echo $(LATEST_TAG) | sed 's/$(BRANCH_SUFFIX)$$//' | cut -d. -f2))
$(eval VORTEX_BUILD_NUMBER ?= $(shell git rev-list --count $(LATEST_TAG)..HEAD))
$(eval VORTEX_VERSION_MAJOR := $(if $(VORTEX_VERSION_MAJOR),$(VORTEX_VERSION_MAJOR),0))
$(eval VORTEX_VERSION_MINOR := $(if $(VORTEX_VERSION_MINOR),$(VORTEX_VERSION_MINOR),1))
$(eval VORTEX_BUILD_NUMBER := $(if $(VORTEX_BUILD_NUMBER),$(VORTEX_BUILD_NUMBER),0))
$(eval VORTEX_VERSION_NUMBER := $(VORTEX_VERSION_MAJOR).$(VORTEX_VERSION_MINOR).$(VORTEX_BUILD_NUMBER))
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,37 @@ This branch holds the master firmware that forms the foundation for all other br

### Desktop (Dynamic Desktop Library)
![Desktop](https://github.com/StoneOrbits/VortexEngine/actions/workflows/desktop_build.yml/badge.svg?branch=desktop)
![Desktop Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/desktop/library?badge=true)
This is a sophisticated enhancement of the core to turn Vortex into a powerful desktop library that can be used to design various desktop applications like the Vortex Editor.

### Orbit (Vortex Classic Orbit)
![Orbit](https://github.com/StoneOrbits/VortexEngine/actions/workflows/orbit_build.yml/badge.svg?branch=orbit)
![Orbit Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/orbit/firmware?badge=true)
The firmware specifically designed for the Vortex Classic Orbit resides here.

### Handle (Vortex Omega Handles)
![Handle](https://github.com/StoneOrbits/VortexEngine/actions/workflows/handle_build.yml/badge.svg?branch=handle)
![Handle Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/handle/firmware?badge=true)
This branch hosts the firmware designed for the Vortex Omega Handles.

### Gloves (Vortex Wired Gloveset)
![Gloves](https://github.com/StoneOrbits/VortexEngine/actions/workflows/gloves_build.yml/badge.svg?branch=gloves)
![Gloves Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/gloves/firmware?badge=true)
Here, you'll find the firmware for the Vortex Wired Gloveset.

### Duo (Vortex Duo Modular Chip)
![Duo](https://github.com/StoneOrbits/VortexEngine/actions/workflows/duo_build.yml/badge.svg?branch=duo)
![Duo Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/duo/firmware?badge=true)
This branch contains the firmware for the Vortex Duo Modular Chip.

### Chromadeck (Vortex Chromadeck Mode Bank)
![Chromadeck](https://github.com/StoneOrbits/VortexEngine/actions/workflows/chromadeck_build.yml/badge.svg?branch=chromadeck)
![Chromadeck Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/chromadeck/firmware?badge=true)
This branch contains the firmware for the Vortex Chromadeck dynamic storage and transfer tool.

### Spark (Spark Orbit and Handle)
![Spark](https://github.com/StoneOrbits/VortexEngine/actions/workflows/spark_build.yml/badge.svg?branch=spark)
![Spark Version](https://img.shields.io/endpoint?url=https://vortex.community/downloads/json/spark/firmware?badge=true)
This branch contains the firmware for the Vortex Spark firmware, this powers multiple devices: the Spark Orbit and Spark Handle.

To access a device's firmware, simply switch to its corresponding branch.
26 changes: 22 additions & 4 deletions VortexEngine/VortexCLI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.SUFFIXES:

# List all make targets which are not filenames
.PHONY: all tests clean wasm
.PHONY: all tests clean wasm compute_version

# compiler tool definitions
ifdef WASM
Expand All @@ -19,9 +19,16 @@ RANLIB=ranlib

CFLAGS=-O2 -g -Wall

# The branch/tag suffix for this device
BRANCH_SUFFIX=s

# compiler defines
DEFINES=\
-D VORTEX_LIB
-D VORTEX_LIB \
-D VORTEX_VERSION_MAJOR=$(VORTEX_VERSION_MAJOR) \
-D VORTEX_VERSION_MINOR=$(VORTEX_VERSION_MINOR) \
-D VORTEX_BUILD_NUMBER=$(VORTEX_BUILD_NUMBER) \
-D VORTEX_VERSION_NUMBER=$(VORTEX_VERSION_NUMBER)

# compiler include paths
INCLUDES=\
Expand Down Expand Up @@ -107,8 +114,8 @@ wasm: FORCE
env WASM=1 $(MAKE)

# target for vortex lib
vortex: $(DEPS)
$(CC) $(CFLAGS) $^ -o $@ $(LLIBS)
vortex: compute_version $(DEPS)
$(CC) $(CFLAGS) $(DEPS) -o $@ $(LLIBS)

# catch-all make target to generate .o and .d files
%.o: %.cpp
Expand All @@ -129,6 +136,17 @@ clean:
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS) vortex.wasm *.txt FlashStorage.flash
$(MAKE) -C ../VortexLib clean

# calculate the version number of the build
compute_version:
$(eval LATEST_TAG ?= $(shell git fetch --depth=1 origin +refs/tags/*:refs/tags/* &> /dev/null && git tag --list "*$(BRANCH_SUFFIX)" | sort -V | tail -n1))
$(eval VORTEX_VERSION_MAJOR ?= $(shell echo $(LATEST_TAG) | cut -d. -f1))
$(eval VORTEX_VERSION_MINOR ?= $(shell echo $(LATEST_TAG) | sed 's/$(BRANCH_SUFFIX)$$//' | cut -d. -f2))
$(eval VORTEX_BUILD_NUMBER ?= $(shell git rev-list --count $(LATEST_TAG)..HEAD))
$(eval VORTEX_VERSION_MAJOR := $(if $(VORTEX_VERSION_MAJOR),$(VORTEX_VERSION_MAJOR),0))
$(eval VORTEX_VERSION_MINOR := $(if $(VORTEX_VERSION_MINOR),$(VORTEX_VERSION_MINOR),1))
$(eval VORTEX_BUILD_NUMBER := $(if $(VORTEX_BUILD_NUMBER),$(VORTEX_BUILD_NUMBER),0))
$(eval VORTEX_VERSION_NUMBER := $(VORTEX_VERSION_MAJOR).$(VORTEX_VERSION_MINOR).$(VORTEX_BUILD_NUMBER))

# Now include our target dependency files
# the hyphen means ignore non-existent files
-include $(DFILES)
6 changes: 3 additions & 3 deletions VortexEngine/VortexCLI/VortexCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ bool VortexCLI::init(int argc, char *argv[])
}

// do the vortex init/setup
Vortex::init<VortexCLICallbacks>();
Vortex::initEx<VortexCLICallbacks>();

// configure the vortex engine as the parameters dictate
Vortex::setInstantTimestep(m_noTimestep);
Expand Down Expand Up @@ -632,10 +632,10 @@ void VortexCLI::cleanup()
}
if (m_jsonMode & JSON_MODE_WRITE_STDOUT) {
// dump the current save in json format
Vortex::dumpJson(nullptr, m_jsonPretty);
Vortex::printJson(m_jsonPretty);
}
if (m_jsonMode & JSON_MODE_WRITE_FILE) {
Vortex::dumpJson(m_jsonOutFile.c_str(), m_jsonPretty);
Vortex::printJsonToFile(m_jsonOutFile.c_str(), m_jsonPretty);
printf("Wrote JSON to file [%s]\n", m_jsonOutFile.c_str());
}
if (m_writeSaveFile.length() > 0) {
Expand Down
34 changes: 18 additions & 16 deletions VortexEngine/VortexLib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.SUFFIXES:

# List all make targets which are not filenames
.PHONY: all tests clean wasm
.PHONY: all tests clean wasm compute_version

# compiler tool definitions
ifdef WASM
Expand All @@ -24,17 +24,8 @@ ifndef WASM
CFLAGS += -g
endif

# Determine the current version based on Git tags
VORTEX_VERSION_MAJOR ?= $(shell git fetch --depth=1 origin +refs/tags/*:refs/tags/* &> /dev/null && git tag --list | grep -E "^[[:digit:]]+\.[[:digit:]]+\$$" | sort -V | tail -n1 | cut -d. -f1)
VORTEX_VERSION_MINOR ?= $(shell git tag --list | grep -E "^[[:digit:]]+\.[[:digit:]]+\$$" | sort -V | tail -n1 | cut -d. -f2)
VORTEX_BUILD_NUMBER ?= $(shell git rev-list --count HEAD)

# If no tags are found, default to 0.1.0
VORTEX_VERSION_MAJOR := $(if $(VORTEX_VERSION_MAJOR),$(VORTEX_VERSION_MAJOR),0)
VORTEX_VERSION_MINOR := $(if $(VORTEX_VERSION_MINOR),$(VORTEX_VERSION_MINOR),1)
VORTEX_BUILD_NUMBER := $(if $(VORTEX_BUILD_NUMBER),$(VORTEX_BUILD_NUMBER),0)

VORTEX_VERSION_NUMBER ?= $(VORTEX_VERSION_MAJOR).$(VORTEX_VERSION_MINOR).$(VORTEX_BUILD_NUMBER)
# The branch/tag suffix for this device
BRANCH_SUFFIX=s

# compiler defines
DEFINES=\
Expand Down Expand Up @@ -132,11 +123,11 @@ wasm: FORCE
env WASM=1 $(MAKE)

# target for vortex lib
vortex.a: $(DEPS)
$(AR) $@ $^
vortex.a: compute_version $(DEPS)
$(AR) $@ $(DEPS)

VortexLib.js: $(DEPS)
$(CC) $(LDFLAGS) $^ -o $@ $(LLIBS)
VortexLib.js: compute_version $(DEPS)
$(CC) $(LDFLAGS) $(DEPS) -o $@ $(LLIBS)

# catch-all make target to generate .o and .d files
%.o: %.cpp
Expand All @@ -156,6 +147,17 @@ FORCE:
clean:
@$(RM) $(DFILES) $(OBJS) $(TARGETS) $(TESTS) VortexLib.js vortex.wasm

# calculate the version number of the build
compute_version:
$(eval LATEST_TAG ?= $(shell git fetch --depth=1 origin +refs/tags/*:refs/tags/* &> /dev/null && git tag --list "*$(BRANCH_SUFFIX)" | sort -V | tail -n1))
$(eval VORTEX_VERSION_MAJOR ?= $(shell echo $(LATEST_TAG) | cut -d. -f1))
$(eval VORTEX_VERSION_MINOR ?= $(shell echo $(LATEST_TAG) | sed 's/$(BRANCH_SUFFIX)$$//' | cut -d. -f2))
$(eval VORTEX_BUILD_NUMBER ?= $(shell git rev-list --count $(LATEST_TAG)..HEAD))
$(eval VORTEX_VERSION_MAJOR := $(if $(VORTEX_VERSION_MAJOR),$(VORTEX_VERSION_MAJOR),0))
$(eval VORTEX_VERSION_MINOR := $(if $(VORTEX_VERSION_MINOR),$(VORTEX_VERSION_MINOR),1))
$(eval VORTEX_BUILD_NUMBER := $(if $(VORTEX_BUILD_NUMBER),$(VORTEX_BUILD_NUMBER),0))
$(eval VORTEX_VERSION_NUMBER := $(VORTEX_VERSION_MAJOR).$(VORTEX_VERSION_MINOR).$(VORTEX_BUILD_NUMBER))

# Now include our target dependency files
# the hyphen means ignore non-existent files
-include $(DFILES)
Loading

0 comments on commit 2a69175

Please sign in to comment.