Skip to content

Commit 275737d

Browse files
committed
Do not use dynamic allocation on dmaMutex's control block
1 parent fcd7270 commit 275737d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

targets/TARGET_STM/stm_dma_utils.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "cmsis_os.h"
2828
#include "cmsis_os2.h"
2929
static osMutexId dmaMutex;
30+
static osRtxMutex_t dmaMutexMem;
3031
#endif
3132

3233
// Array to store pointer to DMA handle for each DMA channel.
@@ -39,8 +40,8 @@ void stm_init_dma_mutex()
3940
osMutexAttr_t attr = {
4041
.name = "dma_mutex",
4142
.attr_bits = osMutexRecursive|osMutexPrioInherit,
42-
.cb_mem = NULL,
43-
.cb_size = 0
43+
.cb_mem = &dmaMutexMem,
44+
.cb_size = sizeof(osRtxMutex_t)
4445
};
4546
dmaMutex = osMutexNew(&attr);
4647
#endif

0 commit comments

Comments
 (0)