You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/09/18 10:33:53 UTC

[incubator-nuttx] 01/05: arch/sim: Implement up_puts function

This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5b75df2203df242665cf8f101b1633e4be45cec0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Sep 17 13:49:20 2021 +0800

    arch/sim: Implement up_puts function
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/sim/src/Makefile      |  2 +-
 arch/sim/src/sim/up_puts.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 65351da..a106114 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -57,7 +57,7 @@ CSRCS  = up_initialize.c up_idle.c up_interruptcontext.c up_initialstate.c
 CSRCS += up_createstack.c up_usestack.c up_releasestack.c up_stackframe.c
 CSRCS += up_unblocktask.c up_blocktask.c up_releasepending.c
 CSRCS += up_reprioritizertr.c up_exit.c up_schedulesigaction.c
-CSRCS += up_heap.c up_uart.c up_assert.c
+CSRCS += up_heap.c up_uart.c up_assert.c up_puts.c
 CSRCS += up_copyfullstate.c
 CSRCS += up_sigdeliver.c
 
diff --git a/arch/sim/src/sim/up_puts.c b/arch/sim/src/sim/up_puts.c
new file mode 100644
index 0000000..11471f9
--- /dev/null
+++ b/arch/sim/src/sim/up_puts.c
@@ -0,0 +1,60 @@
+/****************************************************************************
+ * arch/sim/src/sim/up_puts.c
+ *
+ * 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/config.h>
+#include <nuttx/arch.h>
+
+#include "up_internal.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_puts
+ *
+ * Description:
+ *   This is a low-level helper function used to support debug.
+ *
+ ****************************************************************************/
+
+void up_puts(const char *str)
+{
+  while (*str)
+    {
+      up_putc(*str++);
+    }
+}