16#ifndef _PICO_PLATFORM_H
17#define _PICO_PLATFORM_H
20#error pico/platform.h should not be included directly; include pico.h instead
23#include "pico/platform/compiler.h"
24#include "pico/platform/sections.h"
25#include "pico/platform/panic.h"
26#include "hardware/regs/addressmap.h"
27#include "hardware/regs/sio.h"
30#ifndef PICO_STACK_SIZE
31#define PICO_STACK_SIZE _u(0x800)
36#define PICO_HEAP_SIZE _u(0x800)
40#ifndef PICO_NO_RAM_VECTOR_TABLE
41#define PICO_NO_RAM_VECTOR_TABLE 0
45#ifndef PICO_RP2040_B0_SUPPORTED
46#define PICO_RP2040_B0_SUPPORTED 1
50#ifndef PICO_FLOAT_SUPPORT_ROM_V1
51#define PICO_FLOAT_SUPPORT_ROM_V1 1
55#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
56#define PICO_DOUBLE_SUPPORT_ROM_V1 1
60#ifndef PICO_RP2040_B1_SUPPORTED
61#define PICO_RP2040_B1_SUPPORTED 1
65#ifndef PICO_RP2040_B2_SUPPORTED
66#define PICO_RP2040_B2_SUPPORTED 1
70#ifndef PICO_RP2350_A2_SUPPORTED
71#define PICO_RP2350_A2_SUPPORTED 1
74#ifndef PICO_RAM_VECTOR_TABLE_SIZE
75#define PICO_RAM_VECTOR_TABLE_SIZE (VTABLE_FIRST_IRQ + NUM_IRQS)
104 pico_default_asm_volatile(
107 :
"+l" (minimum_cycles) : :
"cc",
"memory"
112#ifndef PICO_NO_FPGA_CHECK
113#define PICO_NO_FPGA_CHECK 1
116#if PICO_NO_FPGA_CHECK
117static inline bool running_on_fpga(
void) {
return false;}
119bool running_on_fpga(
void);
126 pico_default_asm_volatile (
"bkpt #0" : : :
"memory");
135 return (*(uint32_t *) (SIO_BASE + SIO_CPUID_OFFSET));
153 pico_default_asm_volatile (
"mrs %0, ipsr" :
"=l" (exception));
157#define host_safe_hw_ptr(x) ((uintptr_t)(x))
158#define native_safe_hw_ptr(x) host_safe_hw_ptr(x)
171 GCC_Pragma(
"GCC diagnostic push")
172 GCC_Pragma(
"GCC diagnostic ignored \"-Warray-bounds\"")
173 return *(uint8_t*)0x13;
174 GCC_Pragma(
"GCC diagnostic pop")
189__asm (
"mul %0, %0, %1" :
"+l" (a) :
"l" (b) : );
191pico_default_asm (
"muls %0, %1" :
"+l" (a) :
"l" (b) :
"cc");
209#define __fast_mul(a, b) __builtin_choose_expr(__builtin_constant_p(b) && !__builtin_constant_p(a), \
210 (__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \