Skip to content

Commit 8e08268

Browse files
authored
Merge pull request #8400 from Stary2001/stm32-dynamic-queues
Make packet pool dynamic again on STM32 as a workaround
2 parents 871986d + 1d4134c commit 8e08268

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mesh/Router.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
(MAX_RX_TOPHONE + MAX_RX_FROMRADIO + 2 * MAX_TX_QUEUE + \
3636
2) // max number of packets which can be in flight (either queued from reception or queued for sending)
3737

38+
static MemoryDynamic<meshtastic_MeshPacket> dynamicPool;
39+
Allocator<meshtastic_MeshPacket> &packetPool = dynamicPool;
40+
#elif defined(ARCH_STM32WL)
41+
// On STM32 there isn't enough heap left over for the rest of the firmware if we allocate this statically.
42+
// For now, make it dynamic again.
43+
#define MAX_PACKETS \
44+
(MAX_RX_TOPHONE + MAX_RX_FROMRADIO + 2 * MAX_TX_QUEUE + \
45+
2) // max number of packets which can be in flight (either queued from reception or queued for sending)
46+
3847
static MemoryDynamic<meshtastic_MeshPacket> dynamicPool;
3948
Allocator<meshtastic_MeshPacket> &packetPool = dynamicPool;
4049
#else

0 commit comments

Comments
 (0)