Skip to content

Commit

Permalink
Add white whale kria alt firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
Dewb committed Sep 14, 2023
1 parent 168ff7e commit 80ac01e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions firmware/whitewhale-kria
Submodule whitewhale-kria added at 1e0e2f
28 changes: 13 additions & 15 deletions firmware/whitewhale.mk
Original file line number Diff line number Diff line change
@@ -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
12 changes: 7 additions & 5 deletions src/common/core/LibAVR32ModuleWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
));
}

Expand Down Expand Up @@ -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<SwitchFirmwareItem>(
&MenuItem::text, "Switch Firmware", &MenuItem::rightText, RIGHT_ARROW,
&SwitchFirmwareItem::module, m
Expand Down

0 comments on commit 80ac01e

Please sign in to comment.