diff --git a/drivers/segger/CMakeLists.txt b/drivers/segger/CMakeLists.txt index 53ff66cffa8..cbdc9d31c2e 100644 --- a/drivers/segger/CMakeLists.txt +++ b/drivers/segger/CMakeLists.txt @@ -48,6 +48,8 @@ endif() if(CONFIG_SEGGER_RTT) nuttx_add_kernel_library(RTT) + target_sources(RTT PRIVATE segger.c) + set(RTT_SRCS SystemView/SEGGER/SEGGER_RTT.c) if(CONFIG_SEGGER_RTT_SECTION) diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs index 44b0b6ff524..c4ddc05bce8 100644 --- a/drivers/segger/Make.defs +++ b/drivers/segger/Make.defs @@ -24,6 +24,7 @@ TARGET_ZIP = SGDIR = segger ifeq ($(CONFIG_SEGGER_RTT),y) + CSRCS += segger/segger.c CSRCS += segger/SystemView/SEGGER/SEGGER_RTT.c CFLAGS += -Wno-shadow -Wno-pointer-to-int-cast diff --git a/drivers/segger/note_sysview.c b/drivers/segger/note_sysview.c index 78722878226..17424c4bd51 100644 --- a/drivers/segger/note_sysview.c +++ b/drivers/segger/note_sysview.c @@ -158,12 +158,6 @@ static struct note_sysview_driver_s g_note_sysview_driver = } }; -/**************************************************************************** - * Public Data - ****************************************************************************/ - -spinlock_t g_segger_lock = SP_UNLOCKED; - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/drivers/segger/segger.c b/drivers/segger/segger.c new file mode 100644 index 00000000000..24c9c124b9e --- /dev/null +++ b/drivers/segger/segger.c @@ -0,0 +1,37 @@ +/**************************************************************************** + * drivers/segger/segger.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +spinlock_t g_segger_lock = SP_UNLOCKED; + +/**************************************************************************** + * Public Functions + ****************************************************************************/