EtcPal  HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
View other versions:
EtcPal config options

Overview

Compile-time configuration options for EtcPal.

Options starting with "ETCPAL_EMBOS_" are ignored on Windows, macOS and Linux.

To override any of these options, either define them on your compiler command line, or provide a file called etcpal_config.h and:

In the etcpal_config.h file, simply #define any overridden options to the desired value.

Macros

#define ETCPAL_INCLUDE_PACK_64   1
 Whether to build the etcpal/pack64.h functions. More...
 
#define ETCPAL_EMBOS_USE_MALLOC   0
 Whether a malloc() implementation is available. More...
 
#define ETCPAL_EMBOS_MAX_NETINTS   5
 The maximum number of network interfaces that can be tracked by the netint (Network Interfaces) module. More...
 
#define ETCPAL_LOGGING_ENABLED   1
 Enable message logging from the EtcPal library. More...
 
#define ETCPAL_LOG_MSG_PREFIX   "EtcPal: "
 A string which will be prepended to all log messages from the EtcPal library.
 
#define ETCPAL_ASSERT_VERIFY(exp)    ((exp) ? true : (etcpal_assert_verify_fail(#exp, __FILE__, __func__, __LINE__) && false))
 The assertion handler used by the EtcPal library. More...
 
#define ETCPAL_ASSERT(expr)   assert(expr)
 The lower-level debug assert used by the EtcPal library. More...
 
#define ETCPAL_TARGETING_FREERTOS   0
 Indicates whether certain sources should be built based on if the target OS is FreeRTOS. More...
 

Functions

bool etcpal_assert_verify_fail (const char *exp, const char *file, const char *func, int line)
 

Macro Definition Documentation

◆ ETCPAL_ASSERT

#define ETCPAL_ASSERT (   expr)    assert(expr)

The lower-level debug assert used by the EtcPal library.

This is the assertion that gets called by ETCPAL_ASSERT_VERIFY on failure. Redefine this to retain the logging done by the default ETCPAL_ASSERT_VERIFY macro.

By default, just uses the C library assert. If redefining this, it must be redefined as a macro taking a single argument (the assertion expression).

◆ ETCPAL_ASSERT_VERIFY

#define ETCPAL_ASSERT_VERIFY (   exp)     ((exp) ? true : (etcpal_assert_verify_fail(#exp, __FILE__, __func__, __LINE__) && false))

The assertion handler used by the EtcPal library.

By default, evaluates to true on success, or false on failure (additionally asserting and logging). If redefining this, it must be redefined as a macro taking a single argument (the assertion expression).

◆ ETCPAL_EMBOS_MAX_NETINTS

#define ETCPAL_EMBOS_MAX_NETINTS   5

The maximum number of network interfaces that can be tracked by the netint (Network Interfaces) module.

Currently this limit is not necessary and therefore ignored on all targets except lwIP.

◆ ETCPAL_EMBOS_USE_MALLOC

#define ETCPAL_EMBOS_USE_MALLOC   0

Whether a malloc() implementation is available.

Currently this only affects network interface enumeration using lwIP.

◆ ETCPAL_INCLUDE_PACK_64

#define ETCPAL_INCLUDE_PACK_64   1

Whether to build the etcpal/pack64.h functions.

This can be defined to 0 if you are on a platform that does not provide a int64_t/uint64_t type.

◆ ETCPAL_LOGGING_ENABLED

#define ETCPAL_LOGGING_ENABLED   1

Enable message logging from the EtcPal library.

If defined nonzero, the etcpal_init_log_handler() function can be used to register the application for logging messages from EtcPal. These messages typically indicate critical assertion failures that may not otherwise be visible in a release environment.

Note that this only toggles logging from the EtcPal library and does not control if the logging API is enabled as a feature (that is determined by the features passed to etcpal_init()).

◆ ETCPAL_TARGETING_FREERTOS

#define ETCPAL_TARGETING_FREERTOS   0

Indicates whether certain sources should be built based on if the target OS is FreeRTOS.

Set this to 1 to indicate that the target OS is FreeRTOS. Otherwise, set to 0.

Only useful when not using CMake. CMake sets this automatically, and already handles selection of correct sources.

If SDK_OS_FREE_RTOS is defined, EtcPal will automatically define this to 1.