1 /*
2 * FreeRTOS Kernel V10.6.2
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 * Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
5 *
6 * SPDX-License-Identifier: MIT AND BSD-3-Clause
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 * this software and associated documentation files (the "Software"), to deal in
10 * the Software without restriction, including without limitation the rights to
11 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 * the Software, and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in all
16 * copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * https://www.FreeRTOS.org
26 * https://github.com/FreeRTOS
27 */
28
29 #include "FreeRTOS.h"
30
vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer,StackType_t ** ppxIdleTaskStackBuffer,uint32_t * pulIdleTaskStackSize)31 void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
32 StackType_t **ppxIdleTaskStackBuffer,
33 uint32_t *pulIdleTaskStackSize )
34 {
35 /* If the buffers to be provided to the Idle task are declared inside this
36 function then they must be declared static - otherwise they will be allocated on
37 the stack and so not exists after this function exits. */
38 static StaticTask_t xIdleTaskTCB;
39 static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
40
41 /* Pass out a pointer to the StaticTask_t structure in which the Idle task's
42 state will be stored. */
43 *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
44
45 /* Pass out the array that will be used as the Idle task's stack. */
46 *ppxIdleTaskStackBuffer = uxIdleTaskStack;
47
48 /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
49 Note that, as the array is necessarily of type StackType_t,
50 configMINIMAL_STACK_SIZE is specified in words, not bytes. */
51 *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
52 }
53