Skip to content

Commit

Permalink
Not to use kernel provided static memory
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot committed Oct 19, 2023
1 parent d2373c5 commit 579e0b8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#define portSTACK_GROWTH ( 1 )
#define configUSE_MINIMAL_IDLE_HOOK 0 /* Keep this for backward compatibility. */
#define configUSE_PASSIVE_IDLE_HOOK 0
#define configKERNEL_PROVIDED_STATIC_MEMORY 1

#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ static void prvInitialiseTestStack( TCB_t * pxTCB,
( void ) pxTopOfStack;
}

/* ============================ FreeRTOS static allocate function ============================ */

void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize,
BaseType_t xCoreId )
{
static StaticTask_t xIdleTaskTCBs[ configNUMBER_OF_CORES ];
static StackType_t uxIdleTaskStacks[ configNUMBER_OF_CORES ][ configMINIMAL_STACK_SIZE ];

*ppxIdleTaskTCBBuffer = &( xIdleTaskTCBs[ xCoreId ] );
*ppxIdleTaskStackBuffer = &( uxIdleTaskStacks[ xCoreId ][ 0 ] );
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}

/* ============================== Test Cases ============================== */

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ int suiteTearDown( int numFailures )
return numFailures;
}

/* ============================ FreeRTOS static allocate function ============================ */

void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
StackType_t ** ppxIdleTaskStackBuffer,
uint32_t * pulIdleTaskStackSize,
BaseType_t xCoreId )
{
static StaticTask_t xIdleTaskTCBs[ configNUMBER_OF_CORES ];
static StackType_t uxIdleTaskStacks[ configNUMBER_OF_CORES ][ configMINIMAL_STACK_SIZE ];

*ppxIdleTaskTCBBuffer = &( xIdleTaskTCBs[ xCoreId ] );
*ppxIdleTaskStackBuffer = &( uxIdleTaskStacks[ xCoreId ][ 0 ] );
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}

/* ============================== Test Cases ============================== */

/**
Expand Down

0 comments on commit 579e0b8

Please sign in to comment.