Skip to content

Commit 57108fa

Browse files
committed
Move the command array (commandIndex) into PSRAM
1 parent fcaf7ca commit 57108fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,9 +2681,14 @@ bool commandIndexFill()
26812681
}
26822682
commandCount += COMMAND_COUNT - 1;
26832683

2684-
// Allocate the command array
2684+
// Allocate the command array. Never freed
26852685
length = commandCount * sizeof(*commandIndex);
2686-
commandIndex = (int16_t *)malloc(length);
2686+
2687+
if (online.psram == true)
2688+
commandIndex = (int16_t *)ps_malloc(length);
2689+
else
2690+
commandIndex = (int16_t *)malloc(length);
2691+
26872692
if (!commandIndex)
26882693
{
26892694
// Failed to allocate the commandIndex

0 commit comments

Comments
 (0)