Skip to content

Commit

Permalink
Clean up launch config, fix #648, fix #686
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFreund committed Nov 8, 2023
1 parent f5fa61a commit 4c92e92
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 25 deletions.
87 changes: 63 additions & 24 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/tests/RunAllTests",
"MIMode": "gdb",
"cwd": "${workspaceRoot}",
"miDebuggerPath": "gdb",
},
{
"name": "Cortex-Debug J-Link",
"name": "Cortex-Debug Load/Run Debug",
"preLaunchTask": "Build Debug",
"type": "cortex-debug",
"request": "launch",
Expand Down Expand Up @@ -50,27 +41,46 @@
},
},
{
"name": "Cortex-Debug OpenOCD",
"preLaunchTask": "Build Debug",
"name": "Cortex-Debug Load/Run RelWithDebInfo",
"preLaunchTask": "Build RelWithDebInfo",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build/Debug/deluge.elf",
"serverpath": "${workspaceRoot}/toolchain/win32-x64/openocd/bin/openocd.exe",
"servertype": "openocd",
"configFiles": [
"/interface/cmsis-dap.cfg",
"${workspaceRoot}/contrib/renesas-rz-a1lu.cfg",
],
"executable": "${workspaceRoot}/build/RelWithDebInfo/deluge.elf",
"windows": {
"serverpath": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe",
},
"servertype": "jlink",
"device": "R7S721020",
"runToEntryPoint": "main",
"interface": "swd",
//"runToEntryPoint": "main",
"svdFile": "${workspaceRoot}/contrib/rza1.svd",
"overrideLaunchCommands": [
"monitor reset",
"load"
],
"overrideResetCommands": [
"monitor reset",
"load"
],
"overrideRestartCommands": [
"monitor reset",
"load"
],
"rttConfig": {
"enabled": true,
"address": "auto",
"decoders": [
{
"port": 0,
"timestamp": true,
"type": "console"
}
]
},
},
{
"name": "Attach Debug",
"name": "CppDBG Attach Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/debug/deluge7SEG.elf",
Expand All @@ -92,7 +102,7 @@
"svdPath": "${workspaceRoot}/contrib/rza1.svd",
},
{
"name": "Load/Run Debug",
"name": "CppDBG Load/Run Debug",
"type": "cppdbg",
"preLaunchTask": "Build Debug",
"request": "launch",
Expand Down Expand Up @@ -135,7 +145,7 @@
]
},
{
"name": "Load/Run RelWithDebInfo",
"name": "CppDBG Load/Run RelWithDebInfo",
"type": "cppdbg",
"preLaunchTask": "Build RelWithDebInfo",
"request": "launch",
Expand Down Expand Up @@ -177,6 +187,15 @@
},
]
},
{
"name": "Debug Tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/tests/RunAllTests",
"MIMode": "gdb",
"cwd": "${workspaceRoot}",
"miDebuggerPath": "gdb",
},
{
// NOTE: Do not try `load`ing the program using this config
"name": "LLDB Attach Debug",
Expand All @@ -188,6 +207,26 @@
"processCreateCommands": [
"gdb-remote localhost:3333"
],
}
},
{
"name": "Cortex-Debug OpenOCD",
"preLaunchTask": "Build Debug",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build/Debug/deluge.elf",
"serverpath": "${workspaceRoot}/toolchain/win32-x64/openocd/bin/openocd.exe",
"servertype": "openocd",
"configFiles": [
"/interface/cmsis-dap.cfg",
"${workspaceRoot}/contrib/renesas-rz-a1lu.cfg",
],
"device": "R7S721020",
"runToEntryPoint": "main",
"svdFile": "${workspaceRoot}/contrib/rza1.svd",
"rttConfig": {
"enabled": true,
},
},
]
}
7 changes: 7 additions & 0 deletions src/deluge/gui/ui/keyboard/keyboard_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ ActionResult KeyboardScreen::padAction(int32_t x, int32_t y, int32_t velocity) {

// Pad pressed down, add to list if not full
if (velocity) {
//TODO: Logic should be inverted as part of a bigger rewrite
if(currentUIMode == UI_MODE_EXPLODE_ANIMATION
|| currentUIMode == UI_MODE_ANIMATION_FADE
|| currentUIMode == UI_MODE_INSTRUMENT_CLIP_COLLAPSING) {
return ActionResult::DEALT_WITH;
}

int32_t freeSlotIdx = -1;
for (int32_t idx = 0; idx < kMaxNumKeyboardPadPresses; ++idx) {
// Free slot found
Expand Down
10 changes: 9 additions & 1 deletion src/deluge/gui/views/session_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3089,7 +3089,13 @@ Clip* SessionView::gridCreateClip(uint32_t targetSection, Output* targetOutput,
InstrumentClip* newInstrumentClip = (InstrumentClip*)newClip;
// Create a new track for the clip
if (targetOutput == nullptr) {
gridCreateNewTrackForClip(sourceClip->output->type, newInstrumentClip, false);
if(!gridCreateNewTrackForClip(sourceClip->output->type, newInstrumentClip, false)) {
currentSong->sessionClips.deleteAtIndex(0);
newClip->~Clip();
delugeDealloc(newClip);
return nullptr;
}

targetOutput = newInstrumentClip->output;
}

Expand Down Expand Up @@ -3433,6 +3439,8 @@ ActionResult SessionView::gridHandlePadsLaunch(int32_t x, int32_t y, int32_t on,
}
}
}

return ActionResult::ACTIONED_AND_CAUSED_CHANGE;
}
}

Expand Down

0 comments on commit 4c92e92

Please sign in to comment.