@web-font-path: "roboto-debian.css";
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
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
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
52extern "C" {
53#endif
54
55#if PICO_NO_FPGA_CHECK
56static inline bool running_on_fpga(void) {return false;}
57#else
58bool running_on_fpga(void);
59#endif
60
61#if PICO_NO_SIM_CHECK
62static inline bool running_in_sim(void) {return false;}
63#else
64bool running_in_sim(void);
65#endif
66
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
#define __force_inline
Attribute to force inlining of a function regardless of optimization level.
Definition compiler.h:128
static __force_inline void tight_loop_contents(void)
No-op function for the body of tight loops.
Definition common.h:74