drivers/segger: move g_segger_lock to segger.c

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
This commit is contained in:
liwenxiang1
2025-04-14 15:35:14 +08:00
committed by Xiang Xiao
parent 2f625acbe1
commit 525fcb4a45
4 changed files with 40 additions and 6 deletions
+2
View File
@@ -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)
+1
View File
@@ -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
-6
View File
@@ -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
****************************************************************************/
+37
View File
@@ -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 <nuttx/sched.h>
/****************************************************************************
* Public Data
****************************************************************************/
spinlock_t g_segger_lock = SP_UNLOCKED;
/****************************************************************************
* Public Functions
****************************************************************************/