From 6b80574d10bb2614d58ef771c35e53edaf043e55 Mon Sep 17 00:00:00 2001 From: Tomas Cerskus Date: Tue, 26 Jun 2018 17:19:04 +0100 Subject: [PATCH] [efr32] fix building errors on boards without FEM (#2830) --- examples/platforms/efr32/Makefile.am | 2 +- examples/platforms/efr32/fem-control.c | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 examples/platforms/efr32/fem-control.c diff --git a/examples/platforms/efr32/Makefile.am b/examples/platforms/efr32/Makefile.am index 64228a21d..de4a7645a 100644 --- a/examples/platforms/efr32/Makefile.am +++ b/examples/platforms/efr32/Makefile.am @@ -74,6 +74,7 @@ libopenthread_efr32_a_CPPFLAGS = PLATFORM_SOURCES = \ alarm.c \ diag.c \ + fem-control.c \ flash.c \ logging.c \ misc.c \ @@ -112,7 +113,6 @@ nodist_libopenthread_efr32_a_SOURCES @top_builddir@/third_party/silabs/gecko_sdk_suite/v2.2/platform/emlib/src/em_usart.c \ @top_builddir@/third_party/silabs/gecko_sdk_suite/v2.2/platform/radio/rail_lib/hal/efr32/hal_efr.c \ @top_builddir@/third_party/silabs/gecko_sdk_suite/v2.2/platform/radio/rail_lib/hal/hal_common.c \ - @top_builddir@/third_party/silabs/gecko_sdk_suite/v2.2/util/plugin/plugin-common/fem-control/fem-control.c \ $(NULL) noinst_HEADERS = \ diff --git a/examples/platforms/efr32/fem-control.c b/examples/platforms/efr32/fem-control.c new file mode 100644 index 000000000..fa8c91697 --- /dev/null +++ b/examples/platforms/efr32/fem-control.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, The OpenThread Authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hal-config.h" + +#if (HAL_FEM_ENABLE) +#include "../../../third_party/silabs/gecko_sdk_suite/v2.2/util/plugin/plugin-common/fem-control/fem-control.c" +#endif