1 /*
2  * Copyright (c) 2021, Yonatan Schachter
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*
8  * Originally this file is generated by pico-sdk, and some files
9  * try to include it. Therefore, we have to provide that file,
10  * with this exact name.
11  * Since this file ends up included in all pico-sdk code, it's
12  * used to inject workarounds to make pico-sdk compile with Zephyr.
13  */
14 
15 #ifndef _CONFIG_AUTOGEN_H_
16 #define _CONFIG_AUTOGEN_H_
17 
18 /* WORKAROUNDS */
19 
20 /*
21  * static_assert is not supported, so BUILD_ASSERT is used instead.
22  * BUILD_ASSERT is included through toolchain.h.
23  */
24 #include <zephyr/toolchain.h>
25 #if !defined(__cplusplus) && !defined(static_assert)
26 #define static_assert(expr, msg...) BUILD_ASSERT((expr), "" msg)
27 #endif /* static_assert && __cplusplus__ */
28 
29 /* Convert uses of asm, which is not supported in c99, to __asm */
30 #define asm __asm
31 
32 /* Disable binary info */
33 #define PICO_NO_BINARY_INFO 1
34 
35 #ifdef CONFIG_DT_HAS_RASPBERRYPI_PICO_XOSC_ENABLED
36 #include <zephyr/devicetree.h>
37 #define PICO_XOSC_STARTUP_DELAY_MULTIPLIER DT_PROP(DT_NODELABEL(xosc), startup_delay_multiplier)
38 #endif
39 
40 /* Zephyr compatible way of forcing inline */
41 #ifndef __always_inline
42 #define __always_inline ALWAYS_INLINE
43 #endif /* __always_inline */
44 
45 /* Two definitions required for the flash driver */
46 #define __STRING(x) #x
47 
48 #endif
49