diff --git a/TC_Toolchain.cmake b/TC_Toolchain.cmake index fcf0029..8d3abc8 100644 --- a/TC_Toolchain.cmake +++ b/TC_Toolchain.cmake @@ -17,7 +17,7 @@ SET(CMAKE_CXX_COMPILER C:/HighTec/toolchains/tricore/v4.6.6.0-infineon-1.1/bin/t SET(CMAKE_FIND_ROOT_PATH C:/HighTec/toolchains/tricore/v4.6.6.0-infineon-1.1) # path to FreeRTOS -SET(FREE_RTOS_LIB_PATH C:/Data/Projekte/FreeRTOS_TC27x) +SET(FREE_RTOS_LIB_PATH C:/Data/Projekte/FreeRTOS_AppKit_TC277) # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) diff --git a/base_c/src/core_set.c b/base_c/src/core_set.c index c8b1866..2671dc7 100644 --- a/base_c/src/core_set.c +++ b/base_c/src/core_set.c @@ -127,7 +127,7 @@ void embb_core_set_init(embb_core_set_t* core_set, int initializer) { #ifdef EMBB_PLATFORM_THREADING_RTOSTASKS #ifdef __TriCore__ -#define CORE_COUNT 2 //scm34681: 3 +#define CORE_COUNT 3 //scm34681: 3 #endif diff --git a/base_c/src/memory_allocation.c b/base_c/src/memory_allocation.c index d238465..a32ae59 100644 --- a/base_c/src/memory_allocation.c +++ b/base_c/src/memory_allocation.c @@ -44,8 +44,11 @@ enum { void* embb_alloc(size_t bytes) { size_t bytes_to_allocate = 2 * sizeof(size_t)+bytes; +#ifdef EMBB_OS_FREERTOS void* allocated = pvPortMalloc(bytes_to_allocate); - +#else + void* allocated = malloc(bytes_to_allocate); +#endif if (allocated == NULL) return NULL; @@ -74,8 +77,11 @@ void embb_free(void * ptr) { embb_atomic_fetch_and_add_long( &embb_bytes_allocated, (long)(0 - (size_t)(*bytes_allocated))); - +#ifdef EMBB_OS_FREERTOS vPortFree((size_t*)ptr - 2); +#else + free((size_t*)ptr - 2); +#endif } void* embb_alloc_aligned(size_t alignment, size_t size) { @@ -97,8 +103,11 @@ void* embb_alloc_aligned(size_t alignment, size_t size) { size_t additional_bytes = sizeof(size_t) * 3; size_t bytes_to_allocate = (n + 1)*alignment + (additional_bytes - 1); - +#ifdef EMBB_OS_FREERTOS char* allocated = (char *)pvPortMalloc(bytes_to_allocate); +#else + char* allocated = (char *)malloc(bytes_to_allocate); +#endif if (allocated == NULL) return NULL; @@ -146,8 +155,11 @@ void embb_free_aligned(void* ptr) { embb_atomic_fetch_and_add_long( &embb_bytes_allocated, (long)((long)0 - ptr_conv[-3])); - +#ifdef EMBB_OS_FREERTOS vPortFree((void*)ptr_conv[-2]); +#else + free((void*)ptr_conv[-2]); +#endif } size_t embb_get_bytes_allocated() {