Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions cores/rp2040/StackThunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ extern "C" {
uint32_t *stack_thunk_save = nullptr; /* Saved A1 while in BearSSL */
uint32_t stack_thunk_refcnt = 0;

/* Largest stack usage seen in the wild at 6120 */
/* Largest stack usage seen in the wild at 6120 */
#define _stackSize (6400/4)
#define _stackPaint 0xdeadbeef

/* Add a reference, and allocate the stack if necessary */
void stack_thunk_add_ref() {
stack_thunk_refcnt++;
if (stack_thunk_refcnt == 1) {
// The stack must be in DRAM, or an Soft WDT will follow. Not sure why,
// maybe too much time is consumed with the non32-bit exception handler.
// Also, interrupt handling on an IRAM stack would be very slow.
// Strings on the stack would be very slow to access as well.
stack_thunk_ptr = (uint32_t *)malloc(_stackSize * sizeof(uint32_t));
if (!stack_thunk_ptr) {
// This is a fatal error, stop the sketch
Expand Down
2 changes: 1 addition & 1 deletion libraries/MIDIUSB
Submodule MIDIUSB updated 1 files
+1 −1 src/MIDIUSB.cpp