diff --git a/.gitmodules b/.gitmodules index da1e433..57b5f4c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,7 +17,12 @@ [submodule "firmware/ansible"] path = firmware/ansible url = https://github.com/Dewb/ansible + branch = vcvrack [submodule "firmware/firmware/teletype-5"] path = firmware/teletype5 url = https://github.com/Dewb/teletype branch = vcvrack-5 +[submodule "firmware/whitewhale-kria"] + path = firmware/whitewhale-kria + url = https://github.com/Dewb/kria + branch = vcvrack diff --git a/Makefile b/Makefile index ea0c492..9b308f6 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,8 @@ $(ragel): firmware-build: export PATH := $(PWD)/dep/bin:$(PATH) firmware-build: export RACK_DIR := $(realpath $(RACK_DIR)) firmware-build: firmware/*.mk firmware/**/*.c firmware/**/*.h firmware/**/**/*.rl - cd firmware && $(MAKE) -f whitewhale.mk + cd firmware && $(MAKE) -f whitewhale.mk TARGET_NAME=whitewhale + cd firmware && $(MAKE) -f whitewhale.mk TARGET_NAME=whitewhale-kria cd firmware && $(MAKE) -f meadowphysics.mk cd firmware && $(MAKE) -f earthsea.mk cd firmware && $(MAKE) -f teletype.mk TARGET_NAME=teletype4 diff --git a/firmware/whitewhale-kria b/firmware/whitewhale-kria new file mode 160000 index 0000000..1e0e2fb --- /dev/null +++ b/firmware/whitewhale-kria @@ -0,0 +1 @@ +Subproject commit 1e0e2fbb2a81a31ad14ad996c393ed5f6b2c4fbe diff --git a/firmware/whitewhale.mk b/firmware/whitewhale.mk index fca10d7..48a2cbd 100644 --- a/firmware/whitewhale.mk +++ b/firmware/whitewhale.mk @@ -1,27 +1,25 @@ -TARGET_NAME := whitewhale - FLAGS += \ -D__AVR32_UC3B0256__ \ -Imock_hardware \ -Imock_hardware/include \ - -Iwhitewhale/libavr32/src \ - -Iwhitewhale/libavr32/src/usb/midi \ - -Iwhitewhale/libavr32/src/usb/hid \ - -Iwhitewhale/libavr32/src/usb/cdc \ - -Iwhitewhale/libavr32/asf/common/services/usb \ - -Iwhitewhale/libavr32/asf/common/services/usb/uhc \ - -Iwhitewhale/libavr32/conf \ - -Iwhitewhale/libavr32/conf/trilogy \ + -I$(TARGET_NAME)/libavr32/src \ + -I$(TARGET_NAME)/libavr32/src/usb/midi \ + -I$(TARGET_NAME)/libavr32/src/usb/hid \ + -I$(TARGET_NAME)/libavr32/src/usb/cdc \ + -I$(TARGET_NAME)/libavr32/asf/common/services/usb \ + -I$(TARGET_NAME)/libavr32/asf/common/services/usb/uhc \ + -I$(TARGET_NAME)/libavr32/conf \ + -I$(TARGET_NAME)/libavr32/conf/trilogy \ SOURCES = \ - whitewhale/src/main.c \ - whitewhale/libavr32/src/events.c \ - whitewhale/libavr32/src/timers.c \ - whitewhale/libavr32/src/util.c \ + $(TARGET_NAME)/src/main.c \ + $(TARGET_NAME)/libavr32/src/events.c \ + $(TARGET_NAME)/libavr32/src/timers.c \ + $(TARGET_NAME)/libavr32/src/util.c \ $(wildcard mock_hardware/*.c) \ $(wildcard mock_hardware/common/*.c) \ $(wildcard mock_hardware/modules/trilogy/*.c) \ -FLAGS += -DGIT_VERSION="\"$(shell cut -d '-' -f 1 <<< $(shell cd whitewhale; git describe --tags | cut -c 1-)) $(shell cd whitewhale; git describe --always --dirty --exclude '*' | tr '[a-z]' '[A-Z]')\"" +FLAGS += -DGIT_VERSION="\"$(shell cut -d '-' -f 1 <<< $(shell cd $(TARGET_NAME); git describe --tags | cut -c 1-)) $(shell cd $(TARGET_NAME); git describe --always --dirty --exclude '*' | tr '[a-z]' '[A-Z]')\"" include common.mk diff --git a/src/common/core/LibAVR32ModuleWidget.cpp b/src/common/core/LibAVR32ModuleWidget.cpp index 2de8a76..d04059e 100644 --- a/src/common/core/LibAVR32ModuleWidget.cpp +++ b/src/common/core/LibAVR32ModuleWidget.cpp @@ -40,17 +40,19 @@ struct SwitchFirmwareItem : rack::ui::MenuItem ui::Menu* menu = new ui::Menu; // TODO: populate this from looking in the firmware folder for binaries starting with the module basename - std::string names[] = { "teletype4", "teletype5" }; + std::string tt_names[] = { "teletype4", "teletype5" }; + std::string ww_names[] = { "whitewhale", "whitewhale-kria" }; for (int i = 0; i < 2; i++) { + std::string name = module->firmwarePrefix == "teletype" ? tt_names[i] : ww_names[i]; menu->addChild(createCheckMenuItem( - names[i], + name, "", [=]() - { return module->firmware.getLoadedName() == names[i]; }, + { return module->firmware.getLoadedName() == name; }, [=]() - { module->requestReloadFirmware(false, names[i]); } + { module->requestReloadFirmware(false, name); } )); } @@ -119,7 +121,7 @@ struct FirmwareSubmenuItem : MenuItem menu->addChild(new MenuSeparator()); // TODO: enable for other modules - if (m->firmwarePrefix == "teletype") { + if (m->firmwarePrefix == "teletype" || m->firmwarePrefix == "whitewhale") { menu->addChild(construct( &MenuItem::text, "Switch Firmware", &MenuItem::rightText, RIGHT_ARROW, &SwitchFirmwareItem::module, m