Skip to content

Commit 00a99e4

Browse files
Astyle
1 parent 6cdf3f3 commit 00a99e4

File tree

9 files changed

+453
-547
lines changed

9 files changed

+453
-547
lines changed

cores/rp2040/freertos/heap_3a.c

Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
// Hacked to remove the vTaskSuspendAll from heap_3.c
22

33
/*
4-
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
5-
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6-
*
7-
* SPDX-License-Identifier: MIT
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy of
10-
* this software and associated documentation files (the "Software"), to deal in
11-
* the Software without restriction, including without limitation the rights to
12-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13-
* the Software, and to permit persons to whom the Software is furnished to do so,
14-
* subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in all
17-
* copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25-
*
26-
* https://www.FreeRTOS.org
27-
* https://github.com/FreeRTOS
28-
*
29-
*/
4+
FreeRTOS Kernel <DEVELOPMENT BRANCH>
5+
Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6+
7+
SPDX-License-Identifier: MIT
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of
10+
this software and associated documentation files (the "Software"), to deal in
11+
the Software without restriction, including without limitation the rights to
12+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
13+
the Software, and to permit persons to whom the Software is furnished to do so,
14+
subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in all
17+
copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
21+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
22+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
23+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25+
26+
https://www.FreeRTOS.org
27+
https://github.com/FreeRTOS
28+
29+
*/
3030

3131

3232
/*
33-
* Implementation of pvPortMalloc() and vPortFree() that relies on the
34-
* compilers own malloc() and free() implementations.
35-
*
36-
* This file can only be used if the linker is configured to to generate
37-
* a heap memory area.
38-
*
39-
* See heap_1.c, heap_2.c and heap_4.c for alternative implementations, and the
40-
* memory management pages of https://www.FreeRTOS.org for more information.
41-
*/
33+
Implementation of pvPortMalloc() and vPortFree() that relies on the
34+
compilers own malloc() and free() implementations.
35+
36+
This file can only be used if the linker is configured to to generate
37+
a heap memory area.
38+
39+
See heap_1.c, heap_2.c and heap_4.c for alternative implementations, and the
40+
memory management pages of https://www.FreeRTOS.org for more information.
41+
*/
4242

4343
#include <stdlib.h>
4444

45-
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
46-
* all the API functions to use the MPU wrappers. That should only be done when
47-
* task.h is included from an application file. */
45+
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
46+
all the API functions to use the MPU wrappers. That should only be done when
47+
task.h is included from an application file. */
4848
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
4949

5050
#include "FreeRTOS.h"
@@ -53,56 +53,51 @@
5353
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
5454

5555
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 0 )
56-
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
56+
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
5757
#endif
5858

5959
/*-----------------------------------------------------------*/
6060

61-
void * pvPortMalloc( size_t xWantedSize )
62-
{
61+
void * pvPortMalloc(size_t xWantedSize) {
6362
void * pvReturn;
6463

6564
//vTaskSuspendAll();
6665
{
67-
pvReturn = malloc( xWantedSize );
68-
traceMALLOC( pvReturn, xWantedSize );
66+
pvReturn = malloc(xWantedSize);
67+
traceMALLOC(pvReturn, xWantedSize);
6968
}
7069
//( void ) xTaskResumeAll();
7170

72-
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
71+
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
7372
{
74-
if( pvReturn == NULL )
75-
{
73+
if (pvReturn == NULL) {
7674
vApplicationMallocFailedHook();
7775
}
7876
}
79-
#endif
77+
#endif
8078

8179
return pvReturn;
8280
}
8381
/*-----------------------------------------------------------*/
8482

85-
void vPortFree( void * pv )
86-
{
87-
if( pv != NULL )
88-
{
83+
void vPortFree(void * pv) {
84+
if (pv != NULL) {
8985
//vTaskSuspendAll();
9086
{
91-
free( pv );
92-
traceFREE( pv, 0 );
87+
free(pv);
88+
traceFREE(pv, 0);
9389
}
94-
// ( void ) xTaskResumeAll();
90+
// ( void ) xTaskResumeAll();
9591
}
9692
}
9793
/*-----------------------------------------------------------*/
9894

9995
/*
100-
* Reset the state in this file. This state is normally initialized at start up.
101-
* This function must be called by the application before restarting the
102-
* scheduler.
103-
*/
104-
void vPortHeapResetState( void )
105-
{
96+
Reset the state in this file. This state is normally initialized at start up.
97+
This function must be called by the application before restarting the
98+
scheduler.
99+
*/
100+
void vPortHeapResetState(void) {
106101
/* No state needs to be re-initialised in heap_3. */
107102
}
108103
/*-----------------------------------------------------------*/

0 commit comments

Comments
 (0)