Skip to content

Commit 8728a95

Browse files
committed
Add missing pico/platform/common.h symlinks for RP2040/RP2350
The common.h file was consolidated in rp2_common in 2.2.0, but the platform.h include paths weren't updated. Add symlinks to fix the "file not found" compilation error.
1 parent a1438df commit 8728a95

File tree

2 files changed

+170
-0
lines changed
  • src
    • rp2040/pico_platform/include/pico/platform
    • rp2350/pico_platform/include/pico/platform

2 files changed

+170
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _PICO_PLATFORM_COMMON_H
8+
#define _PICO_PLATFORM_COMMON_H
9+
10+
/** \file pico/platform/common.h
11+
* \ingroup pico_platform
12+
*
13+
* \brief Macros and definitions common to all rp2 platforms but not specific to any library
14+
*
15+
* This header may be included by assembly code
16+
*
17+
* Note certain library specific defines are defined here when they are interdpedent across libraries,
18+
* but making an explicit library dependency does not make sense.
19+
*/
20+
21+
// PICO_CONFIG: PICO_MINIMAL_STORED_VECTOR_TABLE, Only store a very minimal vector table in the binary on Arm, type=bool, default=0, advanced=true, group=pico_crt0
22+
#ifndef PICO_MINIMAL_STORED_VECTOR_TABLE
23+
#define PICO_MINIMAL_STORED_VECTOR_TABLE 0
24+
#endif
25+
26+
#if PICO_MINIMAL_STORED_VECTOR_TABLE && (PICO_NO_FLASH && !defined(__riscv))
27+
#if PICO_NUM_VTABLE_IRQS
28+
#warning PICO_NUM_VTABLE_IRQS is specied with PICO_MINIMAL_STORED_VECTOR_TABLE for NO_FLASH Arm binary; ignored
29+
#undef PICO_NUM_VTABLE_IRQS
30+
#endif
31+
#define PICO_NUM_VTABLE_IRQS 0
32+
#else
33+
// PICO_CONFIG: PICO_NUM_VTABLE_IRQS, Number of IRQ handlers in the vector table - can be lowered to save space if you aren't using some higher IRQs, type=int, default=NUM_IRQS, group=hardware_irq
34+
#ifndef PICO_NUM_VTABLE_IRQS
35+
#define PICO_NUM_VTABLE_IRQS NUM_IRQS
36+
#endif
37+
#endif
38+
39+
#ifndef __ASSEMBLER__
40+
41+
// PICO_CONFIG: PICO_NO_FPGA_CHECK, Remove the FPGA platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
42+
#ifndef PICO_NO_FPGA_CHECK
43+
#define PICO_NO_FPGA_CHECK 1
44+
#endif
45+
46+
// PICO_CONFIG: PICO_NO_SIM_CHECK, Remove the SIM platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
47+
#ifndef PICO_NO_SIM_CHECK
48+
#define PICO_NO_SIM_CHECK 1
49+
#endif
50+
51+
#ifdef __cplusplus
52+
extern "C" {
53+
#endif
54+
55+
#if PICO_NO_FPGA_CHECK
56+
static inline bool running_on_fpga(void) {return false;}
57+
#else
58+
bool running_on_fpga(void);
59+
#endif
60+
61+
#if PICO_NO_SIM_CHECK
62+
static inline bool running_in_sim(void) {return false;}
63+
#else
64+
bool running_in_sim(void);
65+
#endif
66+
67+
/*! \brief No-op function for the body of tight loops
68+
* \ingroup pico_platform
69+
*
70+
* No-op function intended to be called by any tight hardware polling loop. Using this ubiquitously
71+
* makes it much easier to find tight loops, but also in the future \#ifdef-ed support for lockup
72+
* debugging might be added
73+
*/
74+
static __force_inline void tight_loop_contents(void) {}
75+
76+
#define host_safe_hw_ptr(x) ((uintptr_t)(x))
77+
#define native_safe_hw_ptr(x) host_safe_hw_ptr(x)
78+
79+
#ifdef __cplusplus
80+
}
81+
#endif
82+
#endif // __ASSEMBLER__
83+
84+
85+
#endif
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _PICO_PLATFORM_COMMON_H
8+
#define _PICO_PLATFORM_COMMON_H
9+
10+
/** \file pico/platform/common.h
11+
* \ingroup pico_platform
12+
*
13+
* \brief Macros and definitions common to all rp2 platforms but not specific to any library
14+
*
15+
* This header may be included by assembly code
16+
*
17+
* Note certain library specific defines are defined here when they are interdpedent across libraries,
18+
* but making an explicit library dependency does not make sense.
19+
*/
20+
21+
// PICO_CONFIG: PICO_MINIMAL_STORED_VECTOR_TABLE, Only store a very minimal vector table in the binary on Arm, type=bool, default=0, advanced=true, group=pico_crt0
22+
#ifndef PICO_MINIMAL_STORED_VECTOR_TABLE
23+
#define PICO_MINIMAL_STORED_VECTOR_TABLE 0
24+
#endif
25+
26+
#if PICO_MINIMAL_STORED_VECTOR_TABLE && (PICO_NO_FLASH && !defined(__riscv))
27+
#if PICO_NUM_VTABLE_IRQS
28+
#warning PICO_NUM_VTABLE_IRQS is specied with PICO_MINIMAL_STORED_VECTOR_TABLE for NO_FLASH Arm binary; ignored
29+
#undef PICO_NUM_VTABLE_IRQS
30+
#endif
31+
#define PICO_NUM_VTABLE_IRQS 0
32+
#else
33+
// PICO_CONFIG: PICO_NUM_VTABLE_IRQS, Number of IRQ handlers in the vector table - can be lowered to save space if you aren't using some higher IRQs, type=int, default=NUM_IRQS, group=hardware_irq
34+
#ifndef PICO_NUM_VTABLE_IRQS
35+
#define PICO_NUM_VTABLE_IRQS NUM_IRQS
36+
#endif
37+
#endif
38+
39+
#ifndef __ASSEMBLER__
40+
41+
// PICO_CONFIG: PICO_NO_FPGA_CHECK, Remove the FPGA platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
42+
#ifndef PICO_NO_FPGA_CHECK
43+
#define PICO_NO_FPGA_CHECK 1
44+
#endif
45+
46+
// PICO_CONFIG: PICO_NO_SIM_CHECK, Remove the SIM platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
47+
#ifndef PICO_NO_SIM_CHECK
48+
#define PICO_NO_SIM_CHECK 1
49+
#endif
50+
51+
#ifdef __cplusplus
52+
extern "C" {
53+
#endif
54+
55+
#if PICO_NO_FPGA_CHECK
56+
static inline bool running_on_fpga(void) {return false;}
57+
#else
58+
bool running_on_fpga(void);
59+
#endif
60+
61+
#if PICO_NO_SIM_CHECK
62+
static inline bool running_in_sim(void) {return false;}
63+
#else
64+
bool running_in_sim(void);
65+
#endif
66+
67+
/*! \brief No-op function for the body of tight loops
68+
* \ingroup pico_platform
69+
*
70+
* No-op function intended to be called by any tight hardware polling loop. Using this ubiquitously
71+
* makes it much easier to find tight loops, but also in the future \#ifdef-ed support for lockup
72+
* debugging might be added
73+
*/
74+
static __force_inline void tight_loop_contents(void) {}
75+
76+
#define host_safe_hw_ptr(x) ((uintptr_t)(x))
77+
#define native_safe_hw_ptr(x) host_safe_hw_ptr(x)
78+
79+
#ifdef __cplusplus
80+
}
81+
#endif
82+
#endif // __ASSEMBLER__
83+
84+
85+
#endif

0 commit comments

Comments
 (0)