[colorlcd] make malloc() thread-safe
This commit is contained in:
committed by
Peter Feerick
parent
6c74af974c
commit
6684489f01
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user