[colorlcd] make malloc() thread-safe

This commit is contained in:
Raphael Coeffic
2021-10-04 21:52:08 +11:00
committed by Peter Feerick
parent 6c74af974c
commit 6684489f01
3 changed files with 24 additions and 0 deletions
+18
View File
@@ -45,6 +45,24 @@ extern caddr_t _sbrk(int nbytes)
}
}
#if defined(THREADSAFE_MALLOC) && !defined(BOOT)
#include <FreeRTOS.h>
#include <task.h>
void __malloc_lock(struct _reent *r)
{
(void)(r);
vTaskSuspendAll();
};
void __malloc_unlock(struct _reent *r)
{
(void)(r);
(void)xTaskResumeAll();
};
#endif
#if !defined(SEMIHOSTING)
extern int _gettimeofday(void *p1, void *p2)
{
+3
View File
@@ -325,6 +325,9 @@ if (MULTIMODULE)
)
endif()
# Make malloc() thread-safe
add_definitions(-DTHREADSAFE_MALLOC)
set(STM32LIB_SRC
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c
+3
View File
@@ -161,6 +161,9 @@ if (MULTIMODULE)
)
endif()
# Make malloc() thread-safe
add_definitions(-DTHREADSAFE_MALLOC)
set(STM32LIB_SRC
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c