From 4202675428340c411e0e5f06530df90d2c4e4e0d Mon Sep 17 00:00:00 2001 From: CuRahman <111998767+CuRahman@users.noreply.github.com> Date: Mon, 17 Jul 2023 18:37:18 -0400 Subject: [PATCH] Added check for board control before including header/function calls (#28008) --- examples/platform/silabs/efr32/uart.cpp | 4 ++++ third_party/silabs/efr32_sdk.gni | 1 + 2 files changed, 5 insertions(+) diff --git a/examples/platform/silabs/efr32/uart.cpp b/examples/platform/silabs/efr32/uart.cpp index 183417b3cc128f..1576e67f4fc907 100644 --- a/examples/platform/silabs/efr32/uart.cpp +++ b/examples/platform/silabs/efr32/uart.cpp @@ -28,7 +28,9 @@ extern "C" { #include "assert.h" #include "em_core.h" #include "em_usart.h" +#ifdef SL_BOARD_NAME #include "sl_board_control.h" +#endif #include "sl_uartdrv_instances.h" #ifdef SL_CATALOG_UARTDRV_EUSART_PRESENT #include "sl_uartdrv_eusart_vcom_config.h" @@ -252,7 +254,9 @@ void uartConsoleInit(void) return; } +#ifdef SL_BOARD_NAME sl_board_enable_vcom(); +#endif // Init a fifo for the data received on the uart InitFifo(&sReceiveFifo, sRxFifoBuffer, MAX_BUFFER_SIZE); diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index de1f70f42c5ce2..11aa2d0e651ed6 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -212,6 +212,7 @@ template("efr32_sdk") { "PLAT=EMBER_PLATFORM_CORTEXM3", "${silabs_mcu}=1", "${silabs_board}=1", + "SL_BOARD_NAME=${silabs_board}", "SL_SUPRESS_DEPRECATION_WARNINGS_SDK_3_1", "__HEAP_SIZE=0", "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1",