From 812e1081033e00624b7ad0260c9704a673c2ab94 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 8 Jan 2020 13:53:09 -0800 Subject: [PATCH] [example-posix] add missing config definitions (#4458) This commit updates `platform-config.h` to add default value for config definitions. This helps suppress the undefined macro warnings. --- examples/platforms/posix/entropy.c | 4 +++ examples/platforms/posix/platform-config.h | 42 +++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/examples/platforms/posix/entropy.c b/examples/platforms/posix/entropy.c index 676b1ebd8..815f11393 100644 --- a/examples/platforms/posix/entropy.c +++ b/examples/platforms/posix/entropy.c @@ -41,6 +41,10 @@ #include "utils/code_utils.h" +#ifndef __SANITIZE_ADDRESS__ +#define __SANITIZE_ADDRESS__ 0 +#endif + #if __SANITIZE_ADDRESS__ != 0 static uint32_t sState = 1; diff --git a/examples/platforms/posix/platform-config.h b/examples/platforms/posix/platform-config.h index 080d0860f..d7fc98d72 100644 --- a/examples/platforms/posix/platform-config.h +++ b/examples/platforms/posix/platform-config.h @@ -35,9 +35,49 @@ /** * @def OPENTHREAD_POSIX_UART_BAUDRATE * - * This setting configures the baudrate of the UART. + * This setting configures the baud rate of the UART. * */ #ifndef OPENTHREAD_POSIX_UART_BAUDRATE #define OPENTHREAD_POSIX_UART_BAUDRATE B115200 #endif + +/** + * @def OPENTHREAD_POSIX_VIRTUAL_TIME + * + * This setting configures whether to use virtual time (used for simulation) in POSIX platform. + * + */ +#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME +#define OPENTHREAD_POSIX_VIRTUAL_TIME 0 +#endif + +/** + * @def OPENTHREAD_POSIX_VIRTUAL_TIME_UART + * + * This setting configures whether to use virtual time for UART. + * + */ +#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME_UART +#define OPENTHREAD_POSIX_VIRTUAL_TIME_UART 0 +#endif + +/** + * @def OPENTHREAD_PLATFORM_USE_PSEUDO_RESET + * + * Define as 1 to enable pseudo-reset. + * + */ +#ifndef OPENTHREAD_PLATFORM_USE_PSEUDO_RESET +#define OPENTHREAD_PLATFORM_USE_PSEUDO_RESET 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE + * + * Define as 1 to enable SPI NCP interface. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPI_ENABLE +#define OPENTHREAD_CONFIG_NCP_SPI_ENABLE 0 +#endif