From b7dd72332c1967fddd16357b711a06691d569707 Mon Sep 17 00:00:00 2001 From: Timo Sandmann Date: Sun, 25 Sep 2022 18:19:51 +0200 Subject: [PATCH] pvPortCalloc() added --- library.json | 2 +- library.properties | 2 +- src/portable/portmacro.h | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library.json b/library.json index 1155043..fdb7074 100644 --- a/library.json +++ b/library.json @@ -8,7 +8,7 @@ "type": "git", "url": "https://github.com/tsandmann/freertos-teensy" }, - "version": "10.5.0-1", + "version": "10.5.0-2", "authors": [ { "name": "Richard Barry", diff --git a/library.properties b/library.properties index ebd00aa..78439f2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=freertos-teensy -version=10.5.0-1 +version=10.5.0-2 author=Richard Barry maintainer=Timo Sandmann sentence=

FreeRTOS Real Time Operating System implemented for Teensy (3.5, 3.6, 4.0, 4.1).

diff --git a/src/portable/portmacro.h b/src/portable/portmacro.h index ec7d34c..cb74859 100644 --- a/src/portable/portmacro.h +++ b/src/portable/portmacro.h @@ -264,20 +264,26 @@ return malloc( xSize ); } + void* calloc( size_t, size_t ) __attribute__( ( __malloc__, __warn_unused_result__, __alloc_size__( 1, 2 ) ) ); + portFORCE_INLINE static void* pvPortCalloc( size_t xNum, size_t xSize ) PRIVILEGED_FUNCTION __attribute__( ( __malloc__, __warn_unused_result__, __alloc_size__( 1, 2 ) ) ); + portFORCE_INLINE static void* pvPortCalloc( size_t xNum, size_t xSize ) PRIVILEGED_FUNCTION { + return calloc( xNum, xSize ); + } + void free( void* ); portFORCE_INLINE static void vPortFree( void* pv ) PRIVILEGED_FUNCTION { free( pv ); } - portFORCE_INLINE static uint32_t __get_PRIMASK(void) { + portFORCE_INLINE static uint32_t __get_PRIMASK( void ) { uint32_t result; - __asm volatile ("MRS %0, primask" : "=r" (result) ); + __asm volatile( "MRS %0, primask" : "=r" ( result ) ); return result; } - portFORCE_INLINE static void __set_PRIMASK(uint32_t pri_mask) { - __asm volatile ("MSR primask, %0" : : "r" (pri_mask) : "memory"); + portFORCE_INLINE static void __set_PRIMASK( uint32_t pri_mask ) { + __asm volatile( "MSR primask, %0" : : "r" ( pri_mask ) : "memory" ); } #ifdef __cplusplus