Configuration
This is the default configuration of the middleware.
When any of the settings shall be modified, it shall be done in dedicated application config lwprintf_opts.h file.
Note
Check Getting started to create configuration file.
- group LWPRINTF_OPT
LwPRINTF options.
Defines
-
LWPRINTF_CFG_OS
Enables
1or disables0operating system support in the library.Note
When
LWPRINTF_CFG_OSis enabled, user must implement functions in System functions group.
-
LWPRINTF_CFG_OS_MUTEX_HANDLE
Mutex handle type.
Note
This value must be set in case LWPRINTF_CFG_OS is set to
1. If data type is not known to compiler, include header file with definition before you define handle type
-
LWPRINTF_CFG_OS_MANUAL_PROTECT
Enables
1or disables0manual mutex lock.When this feature is enabled, together with LWPRINTF_CFG_OS, behavior is as following:
System mutex is kept created during init phase
Calls to direct printing functions are not thread-safe by default anymore
Calls to sprintf (buffer functions) are kept thread-safe
User must manually call lwprintf_protect or lwprintf_protect_ex functions to protect direct printing operation
User must manually call lwprintf_unprotect or lwprintf_unprotect_ex functions to exit protected area
Note
If you prefer to completely disable locking mechanism with this library, turn off LWPRINTF_CFG_OS and fully manually handle mutual exclusion for non-reentrant functions
-
LWPRINTF_CFG_SUPPORT_LONG_LONG
Enables
1or disables0support forlong long inttype, signed or unsigned.
-
LWPRINTF_CFG_SUPPORT_TYPE_INT
Enables
1or disables0support for any specifier accepting any kind of integer types. This is enablingd, b, u, o, i, xspecifiers.
-
LWPRINTF_CFG_SUPPORT_TYPE_POINTER
Enables
1or disables0supportppointer print type.When enabled, architecture must support
uintptr_ttype, normally available with C11 standard
-
LWPRINTF_CFG_SUPPORT_TYPE_FLOAT
Enables
1or disables0supportfand basic float type.This feature is a prerequisite feature be enabled for any floating point types (
e,E,g,G,a,A,f,F).
-
LWPRINTF_CFG_SUPPORT_TYPE_ENGINEERING
Enables
1or disables0support foreandgengineering output type for float numbers.Note
LWPRINTF_CFG_SUPPORT_TYPE_FLOAT has to be enabled to use this feature
-
LWPRINTF_CFG_SUPPORT_TYPE_STRING
Enables
1or disables0support forsfor string output.
-
LWPRINTF_CFG_SUPPORT_TYPE_BYTE_ARRAY
Enables
1or disables0support forkfor hex byte array output.
-
LWPRINTF_CFG_FLOAT_DEFAULT_PRECISION
Specifies default number of precision for floating number.
Represents number of digits to be used after comma if no precision is set with specifier itself
-
LWPRINTF_CFG_ENABLE_SHORTNAMES
Enables
1or disables0optional short names for LwPRINTF API functions.It adds functions for default instance:
lwprintf,lwsnprintfand others
-
LWPRINTF_CFG_ENABLE_STD_NAMES
Enables
1or disables0C standard API names.Disabled by default not to interfere with compiler implementation. Application may need to remove standard C STDIO library from linkage to be able to properly compile LwPRINTF with this option enabled
-
LWPRINTF_CFG_OS