Solaris Software
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1/**
2 * @file macros.h
3 * @brief Compile-time configuration flags and utility macros for SPP.
4 *
5 * Feature flags follow the pattern @c SPP_NO_<FEATURE> — define them to 1
6 * (e.g. in your CMakeLists.txt) to disable the corresponding feature and
7 * reduce code size on constrained targets.
8 *
9 * Naming conventions used in this file:
10 * - Feature-disable flags: SPP_NO_*
11 * - Capacity constants: K_SPP_*
12 */
13
14#ifndef SPP_MACROS_H
15#define SPP_MACROS_H
16
17/* ----------------------------------------------------------------
18 * Feature-disable flags
19 * (Define to 1 in CMake to disable the feature)
20 * ---------------------------------------------------------------- */
21
22/**
23 * @brief Disable dynamic memory allocation (malloc/free).
24 *
25 * When set, the databank and service registry use only static storage.
26 * This is the default mode for bare-metal targets.
27 */
28#ifndef SPP_NO_MALLOC
29#define SPP_NO_MALLOC 0
30#endif
31
32/**
33 * @brief Disable SD card / filesystem storage support.
34 *
35 * When set, the storage HAL stubs return K_SPP_OK without doing anything.
36 */
37#ifndef SPP_NO_STORAGE
38#define SPP_NO_STORAGE 0
39#endif
40
41/* ----------------------------------------------------------------
42 * Capacity constants
43 * ---------------------------------------------------------------- */
44
45/** @brief Number of packets in the static databank pool. */
46#ifndef K_SPP_DATABANK_SIZE
47#define K_SPP_DATABANK_SIZE (50U)
48#endif
49
50/** @brief Maximum number of pub/sub subscribers that can be registered. */
51#ifndef K_SPP_PUBSUB_MAX_SUBSCRIBERS
52#define K_SPP_PUBSUB_MAX_SUBSCRIBERS (8U)
53#endif
54
55/** @brief Maximum number of services that can be registered. */
56#ifndef K_SPP_MAX_SERVICES
57#define K_SPP_MAX_SERVICES (16U)
58#endif
59
60/* ----------------------------------------------------------------
61 * Pub/sub constants
62 * ---------------------------------------------------------------- */
63
64/** @brief APID bitmask meaning "no APID — module neither produces nor consumes". */
65#ifndef K_SPP_APID_NONE
66#define K_SPP_APID_NONE (0x0000U)
67#endif
68
69/** @brief Deferred dispatch ring-buffer size. Must be a power of 2. */
70#ifndef K_SPP_PUBSUB_QUEUE_SIZE
71#define K_SPP_PUBSUB_QUEUE_SIZE (16U)
72#endif
73
74/* Subscriber dispatch priorities — defined in pubsub.h */
75
76#endif /* SPP_MACROS_H */