Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Torus to patch.Init() #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104,836 changes: 104,836 additions & 0 deletions patch_sm/Torus/.vscode/STM32H750x.svd
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in the .vscode dir should be the same as the Patch example.

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions patch_sm/Torus/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"configurations": [
{
"cStandard": "c11",
"compilerPath": "arm-none-eabi-g++.exe",
"cppStandard": "c++17",
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/../../libDaisy/**",
"${workspaceFolder}/../../DaisySP/**"
],
"name": "Win32",
"windowsSdkVersion": "10.0.17763.0"
},
{
"cStandard": "c11",
"compilerPath": "/usr/local/bin/arm-none-eabi-g++",
"cppStandard": "c++17",
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/../../libDaisy/**",
"${workspaceFolder}/../../DaisySP/**"
],
"name": "macOS"
}
],
"version": 4
}
35 changes: 35 additions & 0 deletions patch_sm/Torus/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"configurations": [
{
"configFiles": [
"interface/stlink.cfg",
"target/stm32h7x.cfg"
],
"cwd": "${workspaceFolder}",
"debuggerArgs": [
"-d",
"${workspaceRoot}"
],
"executable": "${workspaceRoot}/build/Torus.elf",
"interface": "swd",
"name": "Cortex Debug",
"openOCDLaunchCommands": [
"init",
"reset init"
],
"preLaunchTask": "build_all_debug",
"preRestartCommands": [
"load",
"enable breakpoint",
"monitor reset"
],
"request": "launch",
"runToMain": true,
"servertype": "openocd",
"showDevDebugOutput": true,
"svdFile": "${workspaceRoot}/.vscode/STM32H750x.svd",
"type": "cortex-debug"
}
],
"version": "0.2.0"
}
69 changes: 69 additions & 0 deletions patch_sm/Torus/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"files.associations": {
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
}
}
106 changes: 106 additions & 0 deletions patch_sm/Torus/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"tasks": [
{
"command": "make clean; make",
"group": {
"isDefault": true,
"kind": "build"
},
"label": "build",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make clean; make; make program",
"label": "build_and_program",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make clean; make; make program-dfu",
"label": "build_and_program_dfu",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make clean;make",
"dependsOn": [
"build_libdaisy",
"build_daisysp"
],
"label": "build_all",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make clean;DEBUG=1 make",
"dependsOn": [
"build_libdaisy",
"build_daisysp"
],
"label": "build_all_debug",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make program-dfu",
"label": "program-dfu",
"problemMatcher": [],
"type": "shell"
},
{
"command": "make program",
"label": "program",
"problemMatcher": [],
"type": "shell"
},
{
"command": "make",
"label": "build_libdaisy",
"options": {
"cwd": "${workspaceFolder}/../../libDaisy"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
},
{
"command": "make",
"label": "build_daisysp",
"options": {
"cwd": "${workspaceFolder}/../../DaisySP"
},
"problemMatcher": [
"$gcc"
],
"type": "shell"
}
],
"version": "2.0.0"
}
77 changes: 77 additions & 0 deletions patch_sm/Torus/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Project Name
TARGET = torus

# Library Locations
LIBDAISY_DIR = ../../libDaisy
STMLIB_DIR = ../../stmlib

# Sources
CPP_SOURCES = torus.cpp \
dsp/fm_voice.cpp \
dsp/part.cpp \
dsp/resonator.cpp \
dsp/string.cpp \
dsp/string_synth_part.cpp \
resources.cpp \
calibrate.cpp \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this line has changed from the Patch example.


CC_SOURCES += $(STMLIB_DIR)/dsp/units.cc \
$(STMLIB_DIR)/utils/random.cc \
cv_scaler.cc \

C_INCLUDES += \
-I. \
-Iresources \
-I../..

# Can't actually add to CFLAGS.. due to libDaisy stuff
# silences warning from stmlib JOIN macros
C_INCLUDES += -Wno-unused-local-typedefs
OPT = -Os

# Core location, and generic makefile.
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
include $(SYSTEM_FILES_DIR)/Makefile


### Need to override all to get support for .cc files
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin

#######################################
# build the application
#######################################
# list of objects
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
vpath %.c $(sort $(dir $(C_SOURCES)))
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(CPP_SOURCES:.cpp=.o)))
vpath %.cpp $(sort $(dir $(CPP_SOURCES)))
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(CC_SOURCES:.cc=.o)))
vpath %.cc $(sort $(dir $(CC_SOURCES)))
# list of ASM program objects
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
vpath %.s $(sort $(dir $(ASM_SOURCES)))

$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
$(CC) -c $(CFLAGS) $(C_STANDARD) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@

$(BUILD_DIR)/%.o: %.cpp Makefile | $(BUILD_DIR)
$(CXX) -c $(CPPFLAGS) $(CPP_STANDARD) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.cpp=.lst)) $< -o $@

$(BUILD_DIR)/%.o: %.cc Makefile | $(BUILD_DIR)
$(CXX) -c $(CPPFLAGS) $(CPP_STANDARD) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.cc=.lst)) $< -o $@

$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@

$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
$(SZ) $@

$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
$(HEX) $< $@

$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
$(BIN) $< $@

$(BUILD_DIR):
mkdir $@
Loading