Change boards/z16/z16f2811 to boards/z16/z16f

to fix the follow error:
Refresh z16f2800100zcog/nsh
LN: include/arch to arch/z16/include
LN: include/arch/board to /workspace/mirtos/nuttx/boards/z16/z16/z16f2800100zcog/include
No directory at /workspace/mirtos/nuttx/boards/z16/z16/z16f2800100zcog/include
This commit is contained in:
Xiang Xiao
2020-01-23 07:26:27 +08:00
committed by Gregory Nutt
parent 12cc24abb2
commit 7d33af1360
25 changed files with 26 additions and 28 deletions
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
############################################################################
# boards/z16/z16f/z16f2800100zcog/tools/dopatch.sh
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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 NuttX 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 OWNER 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.
#
############################################################################
USAGE="${0} [-R] \$PWD"
WD=`pwd`
TOOLDIR=${WD}/boards/z16f2800100zcog/tools
ME=${TOOLDIR}/dopatch.sh
PATCH=${TOOLDIR}/zneo-zdsii-5_0_1-variadic-func-fix.patch
ARGS=${1}
if [ ! -x ${ME} ]; then
echo "ERROR: This script must be executed from the top-level NuttX directory"
echo ${USAGE}
exit 1
fi
if [ ! -r ${PATCH} ]; then
echo "ERROR: Readable patch not found at ${PATCH}"
echo ${USAGE}
exit 1
fi
cd .. || \
{ echo "ERROR: failed to CD to the parent directory"; exit 1; }
cat ${PATCH} | patch ${ARGS} -p1 || \
{ echo "ERROR: patch failed" ; exit 1; }
@@ -0,0 +1,163 @@
diff --git a/apps/nshlib/nsh_console.c b/apps/nshlib/nsh_console.c
index ba7dbe7..45e4ab1 100644
--- a/apps/nshlib/nsh_console.c
+++ b/apps/nshlib/nsh_console.c
@@ -46,6 +46,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
@@ -79,7 +80,12 @@ static FAR struct nsh_vtbl_s *nsh_consoleclone(FAR struct nsh_vtbl_s *vtbl);
static void nsh_consolerelease(FAR struct nsh_vtbl_s *vtbl);
static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl,
FAR const void *buffer, size_t nbytes);
+#if 0
static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl,
FAR const char *fmt, ...);
+#else
+static int nsh_consolevoutput(FAR struct nsh_vtbl_s *vtbl,
+ FAR const char *fmt, va_list ap);
+#endif
static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl);
@@ -213,6 +219,7 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buf
*
****************************************************************************/
+#if 0
static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl,
FAR const char *fmt, ...)
{
@@ -263,6 +270,29 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl,
#endif
}
+#else
+static int nsh_consolevoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap)
+{
+ FAR struct console_stdio_s *pstate = (FAR struct console_stdio_s *)vtbl;
+ int ret;
+
+ /* The stream is open in a lazy fashion. This is done because the file
+ * descriptor may be opened on a different task than the stream. The
+ * actual open will then occur with the first output from the new task.
+ */
+
+ if (nsh_openifnotopen(pstate) != 0)
+ {
+ return ERROR;
+ }
+
+ ret = vfprintf(pstate->cn_outstream, fmt, ap);
+
+ return ret;
+#endif
+}
+#endif
+
/****************************************************************************
* Name: nsh_consolelinebuffer
*
@@ -452,7 +504,11 @@ FAR struct console_stdio_s *nsh_newconsole(void)
pstate->cn_vtbl.release = nsh_consolerelease;
#endif
pstate->cn_vtbl.write = nsh_consolewrite;
+#if 0
pstate->cn_vtbl.output = nsh_consoleoutput;
+#else
+ pstate->cn_vtbl.voutput = nsh_consolevoutput;
+#endif
pstate->cn_vtbl.linebuffer = nsh_consolelinebuffer;
pstate->cn_vtbl.exit = nsh_consoleexit;
@@ -489,3 +545,15 @@ FAR struct console_stdio_s *nsh_newconsole(void)
}
return pstate;
}
+
+int nsh_output(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = vtbl->voutput(vtbl, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
diff --git a/apps/nshlib/nsh_console.h b/apps/nshlib/nsh_console.h
index c78362f..207f9b9 100644
--- a/apps/nshlib/nsh_console.h
+++ b/apps/nshlib/nsh_console.h
@@ -47,6 +47,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
+#include <stdarg.h>
#include <errno.h>
/****************************************************************************
@@ -62,11 +63,13 @@
#define nsh_undirect(v,s) (v)->undirect(v,s)
#define nsh_exit(v,s) (v)->exit(v,s)
+#if 0
#ifdef CONFIG_CPP_HAVE_VARARGS
# define nsh_output(v, ...) (v)->output(v, ##__VA_ARGS__)
#else
# define nsh_output vtbl->output
#endif
+#endif
/* Size of info to be saved in call to nsh_redirect */
@@ -107,6 +110,10 @@ struct nsh_vtbl_s
void (*release)(FAR struct nsh_vtbl_s *vtbl);
#endif
ssize_t (*write)(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer, size_t nbytes);
+#if 0
int (*output)(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...);
+#else
+ int (*voutput)(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap);
+#endif
FAR char *(*linebuffer)(FAR struct nsh_vtbl_s *vtbl);
void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save);
@@ -159,5 +166,6 @@ struct console_stdio_s
/* Defined in nsh_console.c *************************************************/
FAR struct console_stdio_s *nsh_newconsole(void);
+int nsh_output(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...);
#endif /* __APPS_NSHLIB_NSH_CONSOLE_H */
diff --git a/nuttx/include/wdog.h b/nuttx/include/nuttx/wdog.h
index 0aa3584..ac4a36a 100644
--- a/nuttx/include/nuttx/wdog.h
+++ b/nuttx/include/nuttx/wdog.h
@@ -74,7 +74,23 @@ typedef union wdparm_u wdparm_t;
* watchdog function expires. Up to four parameters may be passed.
*/
+#if 0
typedef CODE void (*wdentry_t)(int argc, uint32_t arg1, ...);
+#elif CONFIG_MAX_WDOGPARMS < 1
+typedef CODE void (*wdentry_t)(int argc);
+#elif CONFIG_MAX_WDOGPARMS < 2
+typedef CODE void (*wdentry_t)(int argc, uint32_t arg1);
+#elif CONFIG_MAX_WDOGPARMS < 3
+typedef CODE void (*wdentry_t)(int argc, uint32_t arg1, uint32_t arg2);
+#elif CONFIG_MAX_WDOGPARMS < 4
+typedef CODE void (*wdentry_t)(int argc, uint32_t arg1, uint32_t arg2,
+ uint32_t arg3);
+#elif CONFIG_MAX_WDOGPARMS < 5
+typedef CODE void (*wdentry_t)(int argc, uint32_t arg1, uint32_t arg2,
+ uint32_t arg3, uint32_t arg4);
+#else
+# error Ooops. CONFIG_MAX_WDOGPARMS > 4
+#endif
/* Watchdog 'handle' */