Skip to content

Commit 88f3573

Browse files
committed
move to common include file; update all headers in file, test
1 parent e892b32 commit 88f3573

File tree

5 files changed

+118
-8
lines changed

5 files changed

+118
-8
lines changed

Diff for: examples/all_allocator/test_allocator.c

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
/**
21

2+
/**
3+
* @file test_allocator.c
4+
*
5+
* @brief This file contains a example on how to use a memory allocator with PSRAM and SRAM on a rp2350
6+
*
37
*/
48

9+
/*
10+
The MIT License (MIT)
11+
12+
Copyright (c) 2024 SparkFun Electronics
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a
15+
copy of this software and associated documentation files (the "Software"),
16+
to deal in the Software without restriction, including without limitation
17+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
18+
and/or sell copies of the Software, and to permit persons to whom the
19+
Software is furnished to do so, subject to the following conditions: The
20+
above copyright notice and this permission notice shall be included in all
21+
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
22+
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
23+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
24+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
29+
*/
530
#include "pico/stdlib.h"
6-
#include "sparkfun_pico/sfe_pico_alloc.h"
31+
#include "sparkfun_pico/sfe_pico.h"
732
#include <stdio.h>
833
#include <stdlib.h>
934
#include <string.h>

Diff for: examples/has_psram/has_psram.c

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
/**
21

2+
3+
/**
4+
* @file has_psram.c
5+
*
6+
* @brief This file contains a example on how to detect PSRAM and run a basic test
37
*/
48

9+
/*
10+
The MIT License (MIT)
11+
12+
Copyright (c) 2024 SparkFun Electronics
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a
15+
copy of this software and associated documentation files (the "Software"),
16+
to deal in the Software without restriction, including without limitation
17+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
18+
and/or sell copies of the Software, and to permit persons to whom the
19+
Software is furnished to do so, subject to the following conditions: The
20+
above copyright notice and this permission notice shall be included in all
21+
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
22+
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
23+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
24+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
26+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
29+
*/
530
// include the sparkfun_pico library - copy this into this folder to run
631
#include "pico/stdlib.h"
7-
#include "sparkfun_pico/sfe_pico_boards.h"
8-
#include "sparkfun_pico/sfe_psram.h"
32+
#include "sparkfun_pico/sfe_pico.h"
933

1034
#include <math.h>
1135
#include <stdio.h>

Diff for: examples/psram_allocator/test_allocator.c

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
/**
21

2+
/**
3+
* @file test_allocator.c
4+
*
5+
* @brief This file contains a example on how to use a memory allocator with PSRAM
36
*/
47

8+
/*
9+
The MIT License (MIT)
10+
11+
Copyright (c) 2024 SparkFun Electronics
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a
14+
copy of this software and associated documentation files (the "Software"),
15+
to deal in the Software without restriction, including without limitation
16+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
17+
and/or sell copies of the Software, and to permit persons to whom the
18+
Software is furnished to do so, subject to the following conditions: The
19+
above copyright notice and this permission notice shall be included in all
20+
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
21+
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
22+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+
28+
*/
29+
530
#include "pico/stdlib.h"
6-
#include "sparkfun_pico/sfe_pico_alloc.h"
31+
#include "sparkfun_pico/sfe_pico.h"
732
#include <stdio.h>
833
#include <stdlib.h>
934
#include <string.h>

Diff for: sparkfun_pico/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
add_library(sparkfun_pico INTERFACE)
32

43
target_sources(
54
sparkfun_pico
65
INTERFACE ${CMAKE_CURRENT_LIST_DIR}/sfe_pico_alloc.c
76
${CMAKE_CURRENT_LIST_DIR}/sfe_pico_alloc.h
7+
${CMAKE_CURRENT_LIST_DIR}/sfe_pico.h
88
${CMAKE_CURRENT_LIST_DIR}/sfe_pico_boards.h
99
${CMAKE_CURRENT_LIST_DIR}/sfe_psram.h
1010
${CMAKE_CURRENT_LIST_DIR}/sfe_psram.c

Diff for: sparkfun_pico/sfe_pico.h

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
/**
3+
* @file sfe_pico.h
4+
*
5+
* @brief Simple, single header file to use with our Pico SDK examples
6+
*/
7+
8+
/*
9+
The MIT License (MIT)
10+
11+
Copyright (c) 2024 SparkFun Electronics
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a
14+
copy of this software and associated documentation files (the "Software"),
15+
to deal in the Software without restriction, including without limitation
16+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
17+
and/or sell copies of the Software, and to permit persons to whom the
18+
Software is furnished to do so, subject to the following conditions: The
19+
above copyright notice and this permission notice shall be included in all
20+
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
21+
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
22+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+
28+
*/
29+
30+
#ifndef _SFE_PICO_H_
31+
#define _SFE_PICO_H_
32+
33+
#include "sfe_pico_alloc.h"
34+
#include "sfe_pico_boards.h"
35+
#include "sfe_psram.h"
36+
#endif

0 commit comments

Comments
 (0)