Merged nuttx/apps into master

This commit is contained in:
ziggurat29 2016-06-24 17:13:13 -05:00
commit bd9ab4516e
377 changed files with 5573 additions and 3463 deletions

View File

@ -69,7 +69,7 @@ ROOTDEPPATH = --dep-path .
VPATH =
all: .built
.PHONY: clean depend distclean
.PHONY: clean preconfig depend distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -103,6 +103,8 @@ else
install:
endif
preconfig:
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
ifneq ($(APPNAME),)
ifneq ($(PRIORITY),)

View File

@ -1574,7 +1574,7 @@
USB device interfaces that do not yet have boardctl() commands
(2016-03-25).
7.16 2016-xx-xx Gregory Nutt <gnutt@nuttx.org>
7.16 2016-06-01 Gregory Nutt <gnutt@nuttx.org>
* apps/system/sdcard: Remove the SD card application. This
application violates OS/application interface rules and has been
@ -1599,3 +1599,59 @@
(NUCLEO-F746ZG). From Mark Olsson (2016-05-19).
* apps/netutils/esp8266: ESP8266 driver application. From Pierre-noel
Bouteville (2016-05-21).
* apps/canutils/: Rename uavcan to libuavcan. From Paul Alexander
Patience (2016-05-25).
* apps/examples/media: You can now override the default device driver
path by providing an alternal path on the command line. From Sébastien
Lorquet (2016-06-01).
7.17 2016-xx-xx Gregory Nutt <gnutt@nuttx.org>
* apps/examples/alarm: ioctl call was clobbering file descriptor
(2016-06-02).
* apps/system/flash_eraseall: Removed! This logic violates the OS/
application interface and cannot be supported. The old code can still
be found in the 'Obsoleted' repository (2016-06-03).
* apps/fsutils/flash_eraseall: IOCTL wrapper for MDCIO_BULKERASE command
(2016-06-04).
* apps/system/flash_eraseall: Restored! Using the new IOCTL wrapper at
apps/fsutils/flash_eraseall (2016-06-04).
* apps/canutils/libuavcan: Fix for recent change to STM32 timer frequency
definiitions (2016-06-05).
* Many files: Change to the way that Kconfig files are generated in order
to better support reuse of the apps/ directory in NuttX products. Changes
include: Make the full tree use wildcards make.defs, Add empty preconfig
rules to 'leaf' makefiles, Use directory.mk for recursive dir makefiles,
Individual app kconfig fixes, Recursive Kconfig autogeneration, Add
kconfig files for pcode and tiff, and fix a gitignore rule, From
Sébastien Lorquet (2016-06-06).
* apps/nshlib: Make NSH net-initialization be a configuration option. From
Marten Svanfeld (2016-06-09).
* netutils/ntpc and nshlib: NTP Client: All retries; Add initialization
in NSH network startup logic. From David S. Alessio (2016-06-09) .
* Rearrange make to eliminate Kmenu files From Sebastien Lorquet
(2016-06-09).
* apps/nshlib: ake NSH net-initialization be a configuration option.
From Marten Svanfeldt (2016-06-09).
* Make sure that APPNAME is defined in all Makefiles that generate
applications. From Sebastien Lorquet (2016-06-09).
* apps/netutils/esp8266/: Add logic to set the BAUD rate. From Pierr-
noel Bouteville (2016-06-11).
* apps/netutils/esp8266/: CONFIG_SERIAL_TERMIOS must be defined in
order to set BAUD (2016-06-11).
* Change dbg() and vdbg() to err() and info() (2016-06-11).
* Change some *err() message to *info() messages if what was a *dbg()
message does not indicate and error condition (2016-06-14).
* Add _ to front of debug macros (2016-06-16).
* SYSLOG: Remove llinfo(), *llwarn(), and llerr(). These are no longer
supported in the redesigned syslog() logic (2016-06-20).
* apps/canutils/libcanard: update version. From Paul Alexander Patience
(2016-06-22).
* apps/examples/can: Some variables were not declared in all required
cases. From Sebastien Lorquet (2016-06-23).
* apps/gpsutils/minmean: Fix minmea Makefile to find the libapp at the
apps/. From Alan Carvalho de Assis (2016-06-23).
* apps/canutils/canlib: Basic CAN utility library. From Sebastien Lorquet
(2016-06-24).
* apps/nshlib/Kconfig: Move NSH stuff out of nuttx/configs/Kconfig to
here. Why was it in the NuttX tree in the first place? (2016-06-24).

View File

@ -34,6 +34,7 @@
############################################################################
-include $(TOPDIR)/.config # Current configuration
include $(APPDIR)/Make.defs
# Sub-directories
@ -48,6 +49,7 @@ $(1)_$(2):
$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
endef
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),context)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
@ -57,6 +59,9 @@ nothing:
install:
preconfig: $(foreach SDIR, $(SUBDIRS), $(SDIR)_preconfig)
$(Q) $(MKKCONFIG) -m $(MENUDESC)
context: $(foreach SDIR, $(SUBDIRS), $(SDIR)_context)
depend: $(foreach SDIR, $(SUBDIRS), $(SDIR)_depend)

View File

@ -53,3 +53,11 @@ define REGISTER
$(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated"
endef
endif
# Tools
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
MKKCONFIG = $(APPDIR)\tools\mkkconfig.bat
else
MKKCONFIG = $(APPDIR)/tools/mkkconfig.sh
endif

View File

@ -39,14 +39,7 @@ APPDIR = ${shell pwd}
TOPDIR ?= $(APPDIR)/import
-include $(TOPDIR)/Make.defs
# Tools
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
MKKCONFIG = ${shell $(APPDIR)\tools\mkkconfig.bat}
else
MKKCONFIG = ${shell $(APPDIR)/tools/mkkconfig.sh}
endif
-include $(APPDIR)/Make.defs
# Application Directories
@ -85,9 +78,15 @@ BIN = libapps$(LIBEXT)
all: $(BIN)
.PHONY: import install context context_serialize context_rest .depdirs preconfig depend clean distclean
define MAKE_template
$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
endef
define SDIR_template
$(1)_$(2):
$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
endef
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all)))
@ -119,8 +118,9 @@ context_serialize:
context: context_serialize
Kconfig: $(MKKCONFIG)
$(MKKCONFIG)
Kconfig:
$(foreach SDIR, $(BUILDIRS), $(call MAKE_template,$(SDIR),preconfig))
$(Q) $(MKKCONFIG)
preconfig: Kconfig

View File

@ -136,3 +136,5 @@ distclean: clean
$(call DELFILE, builtin_proto.h)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -205,7 +205,7 @@ int exec_builtin(FAR const char *appname, FAR char * const *argv,
redirfile, O_WRONLY, 0644);
if (ret != 0)
{
sdbg("ERROR: posix_spawn_file_actions_addopen failed: %d\n", ret);
serr("ERROR: posix_spawn_file_actions_addopen failed: %d\n", ret);
goto errout_with_actions;
}
}
@ -217,7 +217,7 @@ int exec_builtin(FAR const char *appname, FAR char * const *argv,
(FAR char * const *)NULL);
if (ret != 0)
{
sdbg("ERROR: task_spawn failed: %d\n", ret);
serr("ERROR: task_spawn failed: %d\n", ret);
goto errout_with_actions;
}

2
canutils/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/Kconfig

View File

@ -1,11 +0,0 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "CAN Utilities"
source "$APPSDIR/canutils/libcanard/Kconfig"
source "$APPSDIR/canutils/libuavcan/Kconfig"
endmenu # CAN Utilities

View File

@ -33,4 +33,6 @@
#
############################################################################
MENUDESC = "CAN Utilities"
include $(APPDIR)/Directory.mk

16
canutils/canlib/Kconfig Normal file
View File

@ -0,0 +1,16 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config CANUTILS_CANLIB
bool "CAN utility library"
default n
depends on CAN && LIB_BOARDCTL
select BOARDCTL_CANINIT
---help---
Enable the CAN utility library
if CANUTILS_CANLIB
endif

39
canutils/canlib/Make.defs Normal file
View File

@ -0,0 +1,39 @@
############################################################################
# apps/canutils/canlib/Make.defs
# Adds selected applications to apps/ build
#
# Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# 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.
#
############################################################################
ifeq ($(CONFIG_CANUTILS_CANLIB),y)
CONFIGURED_APPS += canutils/canlib
endif

45
canutils/canlib/Makefile Normal file
View File

@ -0,0 +1,45 @@
############################################################################
# apps/canutils/canlib/Makefile
#
# Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# 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.
#
############################################################################
-include $(TOPDIR)/Make.defs
# CAN utility library
ASRCS =
CSRCS = canlib_getbaud.c canlib_setbaud.c
CSRCS+= canlib_getloopback.c canlib_setloopback.c
CSRCS+= canlib_getsilent.c canlib_setsilent.c
include $(APPDIR)/Application.mk

View File

@ -0,0 +1,82 @@
/****************************************************************************
* canutils/canlib/canlib_getbaud.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_getbaud
*
* Description:
* Wrapper for CANIOC_GET_BITTIMING
*
* Input Parameter:
* fd - file descriptor of an opened can device
* baud - pointer to a buffer to store the current baud rate
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_getbaud(int fd, FAR int *bauds)
{
int ret;
struct canioc_bittiming_s timings;
ret = ioctl(fd, CANIOC_GET_BITTIMING, (unsigned long)&timings);
if (ret != OK)
{
canerr("CANIOC_GET_BITTIMING failed, errno=%d\n", errno);
return 0;
}
*bauds = timings.bt_baud;
return ret;
}

View File

@ -0,0 +1,83 @@
/****************************************************************************
* canutils/canlib/canlib_getloopback.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_getloopback
*
* Description:
* Wrapper for CANIOC_GET_CONNMODES.
*
* Input Parameter:
* fd - file descriptor of an opened can device
* loopback - pointer to a buffer to store the current loopback mode state.
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_getloopback(int fd, FAR bool *loopback)
{
int ret;
struct canioc_connmodes_s connmodes;
ret = ioctl(fd, CANIOC_GET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
return FALSE;
}
*loopback = (bool)connmodes.bm_loopback;
return ret;
}

View File

@ -0,0 +1,84 @@
/****************************************************************************
* canutils/canlib/canlib_getsilent.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_getsilent
*
* Description:
* Wrapper for CANIOC_GET_CONNMODES.
*
* Input Parameter:
* fd - file descriptor of an opened can device
* loopback - pointer to a buffer to store the current silent mode state.
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_getsilent(int fd, FAR bool *silent)
{
int ret;
struct canioc_connmodes_s connmodes;
ret = ioctl(fd, CANIOC_GET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
return FALSE;
}
*silent = (bool)connmodes.bm_silent;
return ret;
}

View File

@ -0,0 +1,88 @@
/****************************************************************************
* canutils/canlib/canlib_setbaud.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_setbaud
*
* Description:
* Wrapper for CANIOC_SET_BITTIMING
*
* Input Parameter:
* fd - file descriptor of an opened can device
* baud - baud rate to use on the CAN bus
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_setbaud(int fd, int bauds)
{
int ret;
struct canioc_bittiming_s timings;
ret = ioctl(fd, CANIOC_GET_BITTIMING, (unsigned long)&timings);
if (ret != OK)
{
canerr("CANIOC_GET_BITTIMING failed, errno=%d\n", errno);
return ret;
}
timings.bt_baud = bauds;
ret = ioctl(fd, CANIOC_SET_BITTIMING, (unsigned long)&timings);
if (ret != OK)
{
canerr("CANIOC_SET_BITTIMING failed, errno=%d\n", errno);
}
return ret;
}

View File

@ -0,0 +1,90 @@
/****************************************************************************
* canutils/canlib/canlib_setloopback.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_setloopback
*
* Description:
* Wrapper for CANIOC_SET_CONNMODES. When loopback mode is enabled, the CAN
* peripheral transmits on the bus, but only receives its own sent messages.
*
* Input Parameter:
* fd - file descriptor of an opened can device
* loopback - wether to use loopback mode.
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_setloopback(int fd, bool loopback)
{
int ret;
struct canioc_connmodes_s connmodes;
ret = ioctl(fd, CANIOC_GET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
return ret;
}
connmodes.bm_loopback = !!loopback;
ret = ioctl(fd, CANIOC_SET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_SET_CONNMODES failed, errno=%d\n", errno);
}
return ret;
}

View File

@ -0,0 +1,90 @@
/****************************************************************************
* canutils/canlib/canlib_setsilent.c
*
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h>
#include <errno.h>
#include <nuttx/can.h>
/****************************************************************************
* Name: canlib_setsilent
*
* Description:
* Wrapper for CANIOC_SET_CONNMODES. When silent mode is enabled, the CAN
* peripheral never transmits on the bus, but receives all bus traffic.
*
* Input Parameter:
* fd - file descriptor of an opened can device
* loopback - wether to use loopback mode.
*
* Returned Value:
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
* is returned with the errno variable set to indicate the
* nature of the error.
*
****************************************************************************/
int canlib_setsilent(int fd, bool silent)
{
int ret;
struct canioc_connmodes_s connmodes;
ret = ioctl(fd, CANIOC_GET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_GET_CONNMODES failed, errno=%d\n", errno);
return ret;
}
connmodes.bm_silent = !!silent;
ret = ioctl(fd, CANIOC_SET_CONNMODES, (unsigned long)&connmodes);
if (ret != OK)
{
canerr("CANIOC_SET_CONNMODES failed, errno=%d\n", errno);
}
return ret;
}

View File

@ -6,7 +6,7 @@
config CANUTILS_LIBCANARD
bool "libcanard UAVCAN Library"
default n
depends on CAN && CAN_EXTID
depends on CAN && CAN_EXTID && !DISABLE_POLL
---help---
Enable the libcanard UAVCAN library.
@ -20,7 +20,7 @@ config LIBCANARD_URL
config LIBCANARD_VERSION
string "libcanard Version"
default "34195e7f13637bdc79198c94bd1b2e5ecffe9383"
default "a7a6d4c6b105976cccac36e05c42abee566b70c4"
---help---
libcanard version.

View File

@ -44,9 +44,14 @@ LIBCANARD_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBCANARD_URL)))
LIBCANARD_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBCANARD_VERSION)))
LIBCANARD_UNPACKNAME = libcanard-$(LIBCANARD_VERSION)
LIBCANARD_PACKNAME = $(LIBCANARD_UNPACKNAME)$(PACKEXT)
LIBCANARD_SRCDIR = $(LIBCANARD_UNPACKNAME)$(DELIM)src
LIBCANARD_SRCDIR = $(LIBCANARD_UNPACKNAME)
LIBCANARD_DRVDIR = $(LIBCANARD_SRCDIR)$(DELIM)drivers$(DELIM)nuttx
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c
APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)canutils
CFLAGS += -I$(APPS_INCDIR)
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)nuttx.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(CSRCS)
@ -71,12 +76,18 @@ $(LIBCANARD_PACKNAME):
$(LIBCANARD_UNPACKNAME): $(LIBCANARD_PACKNAME)
@echo "Unpacking: $< -> $@"
$(call DELDIR, $@)
$(Q) $(UNPACK) $<
$(Q) touch $@
$(LIBCANARD_SRCDIR)$(DELIM)canard.h: $(LIBCANARD_UNPACKNAME)
$(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h: $(LIBCANARD_SRCDIR)$(DELIM)canard.h
$(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.h: $(LIBCANARD_UNPACKNAME)
$(APPS_INCDIR)$(DELIM)canard.h: $(LIBCANARD_SRCDIR)$(DELIM)canard.h
$(Q) cp $< $@
$(APPS_INCDIR)$(DELIM)canard_nuttx.h: $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.h
$(Q) cp $< $@
$(COBJS): %$(OBJEXT): %.c
@ -88,7 +99,7 @@ $(COBJS): %$(OBJEXT): %.c
install:
context: $(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h
context: $(APPS_INCDIR)$(DELIM)canard.h $(APPS_INCDIR)$(DELIM)canard_nuttx.h
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
@ -104,8 +115,11 @@ clean:
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
$(call DELFILE, $(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h)
$(call DELFILE, $(APPS_INCDIR)$(DELIM)canard.h)
$(call DELFILE, $(APPS_INCDIR)$(DELIM)canard_nuttx.h)
$(call DELDIR, $(LIBCANARD_UNPACKNAME))
$(call DELFILE, $(LIBCANARD_PACKNAME))
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -262,3 +262,5 @@ distclean: clean
$(call DELFILE, $(PYUAVCAN_PACKNAME))
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -23,3 +23,43 @@
}
};
--- libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp.orig 2016-06-05 09:12:29.086814547 -0600
+++ libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp 2016-06-05 09:15:03.676810202 -0600
@@ -31,17 +31,30 @@
# if UAVCAN_STM32_NUTTX
# define TIMX UAVCAN_STM32_GLUE3(STM32_TIM, UAVCAN_STM32_TIMER_NUMBER, _BASE)
-# define TMR_REG(o) (TIMX + (o))
-# define TIMX_INPUT_CLOCK STM32_TIM27_FREQUENCY
+# define TMR_REG(o) (TIMX + (o))
-# define TIMX_IRQn UAVCAN_STM32_GLUE2(STM32_IRQ_TIM, UAVCAN_STM32_TIMER_NUMBER)
+# if UAVCAN_STM32_TIMER_NUMBER == 2
+# define TIMX_INPUT_CLOCK BOARD_TIM2_FREQUENCY
+# elif UAVCAN_STM32_TIMER_NUMBER == 3
+# define TIMX_INPUT_CLOCK BOARD_TIM3_FREQUENCY
+# elif UAVCAN_STM32_TIMER_NUMBER == 4
+# define TIMX_INPUT_CLOCK BOARD_TIM4_FREQUENCY
+# elif UAVCAN_STM32_TIMER_NUMBER == 5
+# define TIMX_INPUT_CLOCK BOARD_TIM5_FREQUENCY
+# elif UAVCAN_STM32_TIMER_NUMBER == 6
+# define TIMX_INPUT_CLOCK BOARD_TIM6_FREQUENCY
+# elif UAVCAN_STM32_TIMER_NUMBER == 7
+# define TIMX_INPUT_CLOCK BOARD_TIM7_FREQUENCY
+# endif
+
+# define TIMX_IRQn UAVCAN_STM32_GLUE2(STM32_IRQ_TIM, UAVCAN_STM32_TIMER_NUMBER)
# endif
# if UAVCAN_STM32_TIMER_NUMBER >= 2 && UAVCAN_STM32_TIMER_NUMBER <= 7
-# define TIMX_RCC_ENR RCC->APB1ENR
-# define TIMX_RCC_RSTR RCC->APB1RSTR
-# define TIMX_RCC_ENR_MASK UAVCAN_STM32_GLUE3(RCC_APB1ENR_TIM, UAVCAN_STM32_TIMER_NUMBER, EN)
-# define TIMX_RCC_RSTR_MASK UAVCAN_STM32_GLUE3(RCC_APB1RSTR_TIM, UAVCAN_STM32_TIMER_NUMBER, RST)
+# define TIMX_RCC_ENR RCC->APB1ENR
+# define TIMX_RCC_RSTR RCC->APB1RSTR
+# define TIMX_RCC_ENR_MASK UAVCAN_STM32_GLUE3(RCC_APB1ENR_TIM, UAVCAN_STM32_TIMER_NUMBER, EN)
+# define TIMX_RCC_RSTR_MASK UAVCAN_STM32_GLUE3(RCC_APB1RSTR_TIM, UAVCAN_STM32_TIMER_NUMBER, RST)
# else
# error "This UAVCAN_STM32_TIMER_NUMBER is not supported yet"
# endif

2
examples/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/Kconfig

View File

@ -1,102 +0,0 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "Examples"
source "$APPSDIR/examples/adc/Kconfig"
source "$APPSDIR/examples/ajoystick/Kconfig"
source "$APPSDIR/examples/alarm/Kconfig"
source "$APPSDIR/examples/bastest/Kconfig"
source "$APPSDIR/examples/bridge/Kconfig"
source "$APPSDIR/examples/buttons/Kconfig"
source "$APPSDIR/examples/can/Kconfig"
source "$APPSDIR/examples/cc3000/Kconfig"
source "$APPSDIR/examples/chat/Kconfig"
source "$APPSDIR/examples/configdata/Kconfig"
source "$APPSDIR/examples/cpuhog/Kconfig"
source "$APPSDIR/examples/cxxtest/Kconfig"
source "$APPSDIR/examples/dhcpd/Kconfig"
source "$APPSDIR/examples/djoystick/Kconfig"
source "$APPSDIR/examples/elf/Kconfig"
source "$APPSDIR/examples/fstest/Kconfig"
source "$APPSDIR/examples/ftpc/Kconfig"
source "$APPSDIR/examples/ftpd/Kconfig"
source "$APPSDIR/examples/hello/Kconfig"
source "$APPSDIR/examples/helloxx/Kconfig"
source "$APPSDIR/examples/json/Kconfig"
source "$APPSDIR/examples/hidkbd/Kconfig"
source "$APPSDIR/examples/keypadtest/Kconfig"
source "$APPSDIR/examples/igmp/Kconfig"
source "$APPSDIR/examples/i2schar/Kconfig"
source "$APPSDIR/examples/lcdrw/Kconfig"
source "$APPSDIR/examples/leds/Kconfig"
source "$APPSDIR/examples/ltdc/Kconfig"
source "$APPSDIR/examples/media/Kconfig"
source "$APPSDIR/examples/mm/Kconfig"
source "$APPSDIR/examples/modbus/Kconfig"
source "$APPSDIR/examples/module/Kconfig"
source "$APPSDIR/examples/mount/Kconfig"
source "$APPSDIR/examples/mtdpart/Kconfig"
source "$APPSDIR/examples/mtdrwb/Kconfig"
source "$APPSDIR/examples/netloop/Kconfig"
source "$APPSDIR/examples/netpkt/Kconfig"
source "$APPSDIR/examples/nettest/Kconfig"
source "$APPSDIR/examples/nrf24l01_term/Kconfig"
source "$APPSDIR/examples/nsh/Kconfig"
source "$APPSDIR/examples/null/Kconfig"
source "$APPSDIR/examples/nx/Kconfig"
source "$APPSDIR/examples/nxterm/Kconfig"
source "$APPSDIR/examples/nxffs/Kconfig"
source "$APPSDIR/examples/nxflat/Kconfig"
source "$APPSDIR/examples/nxhello/Kconfig"
source "$APPSDIR/examples/nximage/Kconfig"
source "$APPSDIR/examples/nxlines/Kconfig"
source "$APPSDIR/examples/nxtext/Kconfig"
source "$APPSDIR/examples/ostest/Kconfig"
source "$APPSDIR/examples/pashello/Kconfig"
source "$APPSDIR/examples/pca9635/Kconfig"
source "$APPSDIR/examples/pipe/Kconfig"
source "$APPSDIR/examples/poll/Kconfig"
source "$APPSDIR/examples/pppd/Kconfig"
source "$APPSDIR/examples/pwm/Kconfig"
source "$APPSDIR/examples/posix_spawn/Kconfig"
source "$APPSDIR/examples/qencoder/Kconfig"
source "$APPSDIR/examples/random/Kconfig"
source "$APPSDIR/examples/relays/Kconfig"
source "$APPSDIR/examples/rgbled/Kconfig"
source "$APPSDIR/examples/rgmp/Kconfig"
source "$APPSDIR/examples/romfs/Kconfig"
source "$APPSDIR/examples/sendmail/Kconfig"
source "$APPSDIR/examples/serialblaster/Kconfig"
source "$APPSDIR/examples/serialrx/Kconfig"
source "$APPSDIR/examples/serloop/Kconfig"
source "$APPSDIR/examples/slcd/Kconfig"
source "$APPSDIR/examples/flash_test/Kconfig"
source "$APPSDIR/examples/smart_test/Kconfig"
source "$APPSDIR/examples/smart/Kconfig"
source "$APPSDIR/examples/smp/Kconfig"
source "$APPSDIR/examples/tcpecho/Kconfig"
source "$APPSDIR/examples/telnetd/Kconfig"
source "$APPSDIR/examples/thttpd/Kconfig"
source "$APPSDIR/examples/timer/Kconfig"
source "$APPSDIR/examples/tiff/Kconfig"
source "$APPSDIR/examples/touchscreen/Kconfig"
source "$APPSDIR/examples/uavcan/Kconfig"
source "$APPSDIR/examples/udp/Kconfig"
source "$APPSDIR/examples/udpblaster/Kconfig"
source "$APPSDIR/examples/discover/Kconfig"
source "$APPSDIR/examples/webserver/Kconfig"
source "$APPSDIR/examples/unionfs/Kconfig"
source "$APPSDIR/examples/usbserial/Kconfig"
source "$APPSDIR/examples/usbterm/Kconfig"
source "$APPSDIR/examples/udgram/Kconfig"
source "$APPSDIR/examples/ustream/Kconfig"
source "$APPSDIR/examples/watchdog/Kconfig"
source "$APPSDIR/examples/wget/Kconfig"
source "$APPSDIR/examples/wgetjson/Kconfig"
source "$APPSDIR/examples/xmlrpc/Kconfig"
source "$APPSDIR/examples/zerocross/Kconfig"
endmenu # Examples

View File

@ -33,4 +33,6 @@
#
############################################################################
MENUDESC = "Examples"
include $(APPDIR)/Directory.mk

View File

@ -484,8 +484,8 @@ examples/ftpc
You may also want to define the following in your configuration file.
Otherwise, you will have not feeback about what is going on:
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_FTPC=y
examples/ftpd
@ -2089,7 +2089,7 @@ examples/usbserial
CONFIG_EXAMPLES_USBSERIAL_ONLYBIG
Send only large, multi-packet messages. Default: Send large and small.
If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then
If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_USB), then
the example code will also manage the USB trace output. The amount of trace output
can be controlled using:
@ -2184,7 +2184,7 @@ examples/usbterm
CONFIG_EXAMPLES_USBTERM_BUFLEN - The size of the input and output
buffers used for receiving data. Default 256 bytes.
If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB, or
If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_USB, or
CONFIG_USBDEV_TRACE), then the example code will also manage the USB trace
output. The amount of trace output can be controlled using:

View File

@ -387,7 +387,7 @@ int ajoy_main(int argc, char *argv[])
int fd;
int tmp;
int ret;
int err = EXIT_FAILURE;
int errcode = EXIT_FAILURE;
/* Reset some globals that might been been left in a bad state */
@ -459,9 +459,9 @@ int ajoy_main(int argc, char *argv[])
}
}
err = EXIT_SUCCESS;
errcode = EXIT_SUCCESS;
errout_with_fd:
close(fd);
return err;
return errcode;
}

View File

@ -279,6 +279,7 @@ int alarm_main(int argc, FAR char *argv[])
/* Open the RTC driver */
printf("Opening %s\n", CONFIG_EXAMPLES_ALARM_DEVPATH);
fd = open(CONFIG_EXAMPLES_ALARM_DEVPATH, O_WRONLY);
if (fd < 0)
{
@ -297,17 +298,20 @@ int alarm_main(int argc, FAR char *argv[])
setrel.sigvalue.sival_int = alarmid;
fd = ioctl(fd, RTC_SET_RELATIVE, (unsigned long)((uintptr_t)&setrel));
if (fd < 0)
ret = ioctl(fd, RTC_SET_RELATIVE, (unsigned long)((uintptr_t)&setrel));
if (ret < 0)
{
int errcode = errno;
fprintf(stderr, "ERROR: RTC_SET_RELATIVE ioctl failed: %d\n",
errcode);
(void)close(fd);
return EXIT_FAILURE;
}
printf("Alarm set in %lu seconds\n", seconds);
printf("Alarm %d set in %lu seconds\n", alarmid, seconds);
(void)close(fd);
return EXIT_SUCCESS;
}

View File

@ -157,3 +157,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -166,3 +166,5 @@ distclean: clean
$(call DELFILE, bridge_config.h)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -302,12 +302,8 @@ static void show_buttons(uint8_t oldset, uint8_t newset)
state = "released";
}
/* Use lowsyslog() because we make be executing from an
* interrupt handler.
*/
lowsyslog(LOG_INFO, " %s %s\n",
g_buttoninfo[BUTTON_INDEX(i)].name, state);
syslog(LOG_INFO, " %s %s\n",
g_buttoninfo[BUTTON_INDEX(i)].name, state);
}
}
}
@ -317,8 +313,8 @@ static void button_handler(int id, int irq)
{
uint8_t newset = board_buttons();
lowsyslog(LOG_INFO, "IRQ:%d Button %d:%s SET:%02x:\n",
irq, id, g_buttoninfo[BUTTON_INDEX(id)].name, newset);
syslog(LOG_INFO, "IRQ:%d Button %d:%s SET:%02x:\n",
irq, id, g_buttoninfo[BUTTON_INDEX(id)].name, newset);
show_buttons(g_oldset, newset);
g_oldset = newset;
@ -421,7 +417,7 @@ int buttons_main(int argc, char *argv[])
maxbuttons = strtol(argv[1], NULL, 10);
}
lowsyslog(LOG_INFO, "maxbuttons: %d\n", maxbuttons);
syslog(LOG_INFO, "maxbuttons: %d\n", maxbuttons);
#endif
/* Initialize the button GPIOs */
@ -435,11 +431,9 @@ int buttons_main(int argc, char *argv[])
{
xcpt_t oldhandler = board_button_irq(i, g_buttoninfo[BUTTON_INDEX(i)].handler);
/* Use lowsyslog() for compatibility with interrupt handler output. */
lowsyslog(LOG_INFO, "Attached handler at %p to button %d [%s], oldhandler:%p\n",
g_buttoninfo[BUTTON_INDEX(i)].handler, i,
g_buttoninfo[BUTTON_INDEX(i)].name, oldhandler);
syslog(LOG_INFO, "Attached handler at %p to button %d [%s], oldhandler:%p\n",
g_buttoninfo[BUTTON_INDEX(i)].handler, i,
g_buttoninfo[BUTTON_INDEX(i)].name, oldhandler);
/* Some hardware multiplexes different GPIO button sources to the same
* physical interrupt. If we register multiple such multiplexed button
@ -450,9 +444,9 @@ int buttons_main(int argc, char *argv[])
if (oldhandler != NULL)
{
lowsyslog(LOG_INFO, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
syslog(LOG_INFO, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
}
}
#endif
@ -480,11 +474,7 @@ int buttons_main(int argc, char *argv[])
flags = enter_critical_section();
/* Use lowsyslog() for compatibility with interrupt handler
* output.
*/
lowsyslog(LOG_INFO, "POLL SET:%02x:\n", newset);
syslog(LOG_INFO, "POLL SET:%02x:\n", newset);
show_buttons(g_oldset, newset);
g_oldset = newset;
leave_critical_section(flags);

View File

@ -175,10 +175,10 @@ int can_main(int argc, FAR char *argv[])
#endif
long minid = 1;
long maxid = MAX_ID;
int msgdlc;
uint8_t msgdata;
int i;
#endif
int msgdlc;
int i;
#ifdef CONFIG_EXAMPLES_CAN_READ
struct can_msg_s rxmsg;

View File

@ -154,3 +154,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -125,7 +125,7 @@ static int telnetd_daemon(int argc, char *argv[])
if (listensd < 0)
{
int errval = errno;
ndbg("socket failure: %d\n", errval);
nerr("ERROR: socket failure: %d\n", errval);
return -errval;
}
@ -135,7 +135,7 @@ static int telnetd_daemon(int argc, char *argv[])
optval = 1;
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
{
ndbg("setsockopt SO_REUSEADDR failure: %d\n", errno);
nerr("ERROR: setsockopt SO_REUSEADDR failure: %d\n", errno);
goto errout_with_socket;
}
#endif
@ -148,7 +148,7 @@ static int telnetd_daemon(int argc, char *argv[])
if (bind(listensd, (struct sockaddr*)&myaddr, sizeof(struct sockaddr_in)) < 0)
{
ndbg("bind failure: %d\n", errno);
nerr("ERROR: bind failure: %d\n", errno);
goto errout_with_socket;
}
@ -156,16 +156,13 @@ static int telnetd_daemon(int argc, char *argv[])
if (listen(listensd, 5) < 0)
{
ndbg("listen failure %d\n", errno);
nerr("ERROR: listen failure %d\n", errno);
goto errout_with_socket;
}
/* Now go silent. Only the lldbg family of debug functions should
* be used after this point because these do not depend on stdout
* being available.
*/
/* Now go silent. */
#ifndef CONFIG_DEBUG
#ifndef CONFIG_DEBUG_FEATURES
close(0);
close(1);
close(2);
@ -175,13 +172,13 @@ static int telnetd_daemon(int argc, char *argv[])
for (;;)
{
nllvdbg("Accepting connections on port %d\n", ntohs(daemon->port));
ninfo("Accepting connections on port %d\n", ntohs(daemon->port));
addrlen = sizeof(struct sockaddr_in);
acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen);
if (acceptsd < 0)
{
nlldbg("accept failed: %d\n", errno);
nerr("ERROR: accept failed: %d\n", errno);
goto errout_with_socket;
}
@ -192,28 +189,28 @@ static int telnetd_daemon(int argc, char *argv[])
ling.l_linger = 30; /* timeout is seconds */
if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
{
nlldbg("setsockopt failed: %d\n", errno);
nerr("ERROR: setsockopt failed: %d\n", errno);
goto errout_with_acceptsd;
}
#endif
/* Create a character device to "wrap" the accepted socket descriptor */
nllvdbg("Creating the telnet driver\n");
ninfo("Creating the telnet driver\n");
devpath = telnetd_driver(acceptsd, daemon);
if (devpath == NULL)
{
nlldbg("telnetd_driver failed\n");
nerr("ERROR: telnetd_driver failed\n");
goto errout_with_acceptsd;
}
/* Open the driver */
nllvdbg("Opening the telnet driver\n");
ninfo("Opening the telnet driver\n");
drvrfd = open(devpath, O_RDWR);
if (drvrfd < 0)
{
nlldbg("Failed to open %s: %d\n", devpath, errno);
nerr("ERROR: Failed to open %s: %d\n", devpath, errno);
goto errout_with_acceptsd;
}
@ -238,12 +235,12 @@ static int telnetd_daemon(int argc, char *argv[])
* will inherit the new stdin, stdout, and stderr.
*/
nllvdbg("Starting the telnet session\n");
ninfo("Starting the telnet session\n");
pid = task_create("Telnet session", daemon->priority, daemon->stacksize,
daemon->entry, NULL);
if (pid < 0)
{
nlldbg("Failed start the telnet session: %d\n", errno);
nerr("ERROR: Failed start the telnet session: %d\n", errno);
goto errout_with_acceptsd;
}
@ -325,7 +322,7 @@ int telnetd_start(FAR struct telnetd_config_s *config)
{
int errval = errno;
free(daemon);
ndbg("Failed to start the telnet daemon: %d\n", errval);
nerr("ERROR: Failed to start the telnet daemon: %d\n", errval);
return -errval;
}

View File

@ -180,11 +180,11 @@ static inline void telnetd_dumpbuffer(FAR const char *msg,
FAR const char *buffer,
unsigned int nbytes)
{
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_NET have to be
* defined or the following does nothing.
*/
nvdbgdumpbuffer(msg, (FAR const uint8_t*)buffer, nbytes);
ninfodumpbuffer(msg, (FAR const uint8_t*)buffer, nbytes);
}
#endif
@ -227,12 +227,12 @@ static ssize_t telnetd_receive(FAR struct telnetd_dev_s *priv, FAR const char *s
int nread;
uint8_t ch;
nllvdbg("srclen: %d destlen: %d\n", srclen, destlen);
ninfo("srclen: %d destlen: %d\n", srclen, destlen);
for (nread = 0; srclen > 0 && nread < destlen; srclen--)
{
ch = *src++;
nllvdbg("ch=%02x state=%d\n", ch, priv->td_state);
ninfo("ch=%02x state=%d\n", ch, priv->td_state);
switch (priv->td_state)
{
@ -397,7 +397,7 @@ static void telnetd_sendopt(FAR struct telnetd_dev_s *priv, uint8_t option,
telnetd_dumpbuffer("Send optbuf", optbuf, 4);
if (send(priv->td_psock, optbuf, 4, 0) < 0)
{
nlldbg("Failed to send TELNET_IAC\n");
nerr("ERROR: Failed to send TELNET_IAC\n");
}
}
@ -412,7 +412,7 @@ static int telnetd_open(FAR struct file *filep)
int tmp;
int ret;
nllvdbg("td_crefs: %d\n", priv->td_crefs);
ninfo("td_crefs: %d\n", priv->td_crefs);
/* O_NONBLOCK is not supported */
@ -468,7 +468,7 @@ static int telnetd_close(FAR struct file *filep)
FAR char *devpath;
int ret;
nllvdbg("td_crefs: %d\n", priv->td_crefs);
ninfo("td_crefs: %d\n", priv->td_crefs);
/* Get exclusive access to the device structures */
@ -498,7 +498,7 @@ static int telnetd_close(FAR struct file *filep)
ret = asprintf(&devpath, TELNETD_DEVFMT, priv->td_minor);
if (ret < 0)
{
nlldbg("Failed to allocate the driver path\n");
nerr("ERROR: Failed to allocate the driver path\n");
}
else
{
@ -507,7 +507,7 @@ static int telnetd_close(FAR struct file *filep)
ret = unregister_driver(devpath);
if (ret < 0)
{
nlldbg("Failed to unregister the driver %s: %d\n", devpath, ret);
nerr("ERROR: Failed to unregister the driver %s: %d\n", devpath, ret);
}
free(devpath);
@ -547,7 +547,7 @@ static ssize_t telnetd_read(FAR struct file *filep, FAR char *buffer, size_t len
FAR struct telnetd_dev_s *priv = inode->i_private;
ssize_t ret;
nllvdbg("len: %d\n", len);
ninfo("len: %d\n", len);
/* First, handle the case where there are still valid bytes left in the
* I/O buffer from the last time that read was called. NOTE: Much of
@ -620,7 +620,7 @@ static ssize_t telnetd_write(FAR struct file *filep, FAR const char *buffer, siz
char ch;
bool eol;
nllvdbg("len: %d\n", len);
ninfo("len: %d\n", len);
/* Process each character from the user buffer */
@ -645,7 +645,7 @@ static ssize_t telnetd_write(FAR struct file *filep, FAR const char *buffer, siz
ret = send(priv->td_psock, priv->td_txbuffer, ncopied, 0);
if (ret < 0)
{
nlldbg("psock_send failed '%s': %d\n", priv->td_txbuffer, ret);
nerr("ERROR: psock_send failed '%s': %d\n", priv->td_txbuffer, ret);
return ret;
}
@ -662,7 +662,7 @@ static ssize_t telnetd_write(FAR struct file *filep, FAR const char *buffer, siz
ret = send(priv->td_psock, priv->td_txbuffer, ncopied, 0);
if (ret < 0)
{
nlldbg("psock_send failed '%s': %d\n", priv->td_txbuffer, ret);
nerr("ERROR: psock_send failed '%s': %d\n", priv->td_txbuffer, ret);
return ret;
}
}
@ -750,7 +750,7 @@ FAR char *telnetd_driver(long sd, FAR struct telnetd_s *daemon)
priv = (FAR struct telnetd_dev_s*)malloc(sizeof(struct telnetd_dev_s));
if (!priv)
{
nlldbg("Failed to allocate the driver data structure\n");
nerr("ERROR: Failed to allocate the driver data structure\n");
return NULL;
}
@ -786,7 +786,7 @@ FAR char *telnetd_driver(long sd, FAR struct telnetd_s *daemon)
ret = asprintf(&devpath, TELNETD_DEVFMT, priv->td_minor);
if (ret < 0)
{
nlldbg("Failed to allocate the driver path\n");
nerr("ERROR: Failed to allocate the driver path\n");
goto errout_with_dev;
}
@ -795,7 +795,7 @@ FAR char *telnetd_driver(long sd, FAR struct telnetd_s *daemon)
ret = register_driver(devpath, &g_telnetdfops, 0666, priv);
if (ret < 0)
{
nlldbg("Failed to register the driver %s: %d\n", devpath, ret);
nerr("ERROR: Failed to register the driver %s: %d\n", devpath, ret);
goto errout_with_devpath;
}

View File

@ -130,3 +130,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -128,7 +128,7 @@ static int chat_script_preset(FAR struct chat_app* priv, int script_number)
{
int ret = 0;
vdbg("preset script %d\n", script_number);
_info("preset script %d\n", script_number);
switch (script_number)
{
@ -340,11 +340,11 @@ int chat_main(int argc, FAR char** argv)
priv.script_dynalloc = false;
strncpy(priv.tty, CONFIG_EXAMPLES_CHAT_TTY_DEVNODE, CHAT_TTYNAME_SIZE-1);
vdbg("parsing the arguments\n");
_info("parsing the arguments\n");
ret = chat_parse_args((FAR struct chat_app*) &priv);
if (ret < 0)
{
vdbg("Command line parsing failed: code %d, errno %d\n", ret, errno);
_info("Command line parsing failed: code %d, errno %d\n", ret, errno);
chat_show_usage();
exit_code = EXIT_FAILURE;
goto with_script;
@ -357,20 +357,20 @@ int chat_main(int argc, FAR char** argv)
goto no_script;
}
vdbg("opening %s\n", priv.tty);
_info("opening %s\n", priv.tty);
priv.ctl.fd = open(priv.tty, O_RDWR);
if (priv.ctl.fd < 0)
{
vdbg("Failed to open %s: %d\n", priv.tty, errno);
_info("Failed to open %s: %d\n", priv.tty, errno);
exit_code = EXIT_FAILURE;
goto with_script;
}
vdbg("setting up character device\n");
_info("setting up character device\n");
ret = chat_chardev(&priv);
if (ret < 0)
{
vdbg("Failed to open %s: %d\n", priv.tty, errno);
_info("Failed to open %s: %d\n", priv.tty, errno);
exit_code = EXIT_FAILURE;
goto with_tty_dev;
}
@ -390,6 +390,6 @@ no_script:
fflush(stderr);
fflush(stdout);
vdbg("Exit code %d\n", exit_code);
_info("Exit code %d\n", exit_code);
return exit_code;
}

View File

@ -37,6 +37,8 @@
# CONFIGDATA Unit Test
APPNAME = configdata
ASRCS =
CSRCS =
MAINSRC = configdata_main.c

View File

@ -408,7 +408,7 @@ static int configdata_verifyconfig(void)
{
FAR struct configdata_entrydesc_s *entry;
int ret;
int err = OK;
int errcode = OK;
int i;
static int iteration = 0;
@ -441,7 +441,7 @@ static int configdata_verifyconfig(void)
printf("ERROR: Failed to read an entry: %d\n", i);
printf(" Entry id: %04X\n", entry->id);
printf(" Entry size: %d\n", entry->len);
err = ERROR;
errcode = ERROR;
}
}
else
@ -453,7 +453,7 @@ static int configdata_verifyconfig(void)
printf("ERROR: Succesffully read a deleted entry\n");
printf(" Entry id: %04X\n", entry->id);
printf(" Entry size: %d\n", entry->len);
err = ERROR;
errcode = ERROR;
}
else
{
@ -466,7 +466,7 @@ static int configdata_verifyconfig(void)
}
}
return err;
return errcode;
}
/****************************************************************************

View File

@ -178,7 +178,7 @@ int discover_main(int argc, char *argv[])
if (discover_start(NULL) < 0)
{
ndbg("Could not start discover daemon.\n");
nerr("ERROR: Could not start discover daemon.\n");
return ERROR;
}

View File

@ -150,7 +150,7 @@ int djoy_main(int argc, char *argv[])
int fd;
int tmp;
int ret;
int err = EXIT_FAILURE;
int errcode = EXIT_FAILURE;
/* Reset some globals that might been been left in a bad state */
@ -248,9 +248,9 @@ int djoy_main(int argc, char *argv[])
g_djoylast = newset;
}
err = EXIT_SUCCESS;
errcode = EXIT_SUCCESS;
errout_with_fd:
close(fd);
return err;
return errcode;
}

View File

@ -136,3 +136,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -100,25 +100,25 @@
# define CONFIG_EXAMPLES_ELF_DEVPATH "/dev/ram0"
#endif
/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the
/* If CONFIG_DEBUG_FEATURES is enabled, use info/err instead of printf so that the
* output will be synchronous with the debug output.
*/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(format, ...) dbg(format, ##__VA_ARGS__)
# define err(format, ...) dbg(format, ##__VA_ARGS__)
# ifdef CONFIG_DEBUG_FEATURES
# define message(format, ...) _info(format, ##__VA_ARGS__)
# define errmsg(format, ...) _err(format, ##__VA_ARGS__)
# else
# define message(format, ...) printf(format, ##__VA_ARGS__)
# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message dbg
# define err dbg
# ifdef CONFIG_DEBUG_FEATURES
# define message _info
# define errmsg _err
# else
# define message printf
# define err printf
# define errmsg printf
# endif
#endif
@ -241,7 +241,7 @@ int elf_main(int argc, char *argv[])
ret = elf_initialize();
if (ret < 0)
{
err("ERROR: Initialization of the ELF loader failed: %d\n", ret);
errmsg("ERROR: Initialization of the ELF loader failed: %d\n", ret);
exit(1);
}
@ -254,7 +254,7 @@ int elf_main(int argc, char *argv[])
NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
err("ERROR: romdisk_register failed: %d\n", ret);
errmsg("ERROR: romdisk_register failed: %d\n", ret);
elf_uninitialize();
exit(1);
}
@ -269,8 +269,8 @@ int elf_main(int argc, char *argv[])
ret = mount(CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, "romfs", MS_RDONLY, NULL);
if (ret < 0)
{
err("ERROR: mount(%s,%s,romfs) failed: %s\n",
CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, errno);
errmsg("ERROR: mount(%s,%s,romfs) failed: %s\n",
CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, errno);
elf_uninitialize();
}
@ -319,7 +319,7 @@ int elf_main(int argc, char *argv[])
ret = load_module(&bin);
if (ret < 0)
{
err("ERROR: Failed to load program '%s'\n", dirlist[i]);
errmsg("ERROR: Failed to load program '%s'\n", dirlist[i]);
exit(1);
}
@ -333,7 +333,7 @@ int elf_main(int argc, char *argv[])
if (ret < 0)
{
err("ERROR: Failed to execute program '%s'\n", dirlist[i]);
errmsg("ERROR: Failed to execute program '%s'\n", dirlist[i]);
}
else
{

View File

@ -35,7 +35,7 @@
-include $(TOPDIR)/Make.defs
# Generic file system stress test appliation info
# Generic file system stress test application info
APPNAME = fstest
PRIORITY = SCHED_PRIORITY_DEFAULT

View File

@ -318,21 +318,22 @@ static inline int fstest_wrfile(FAR struct fstest_filedesc_s *file)
nbyteswritten = write(fd, &g_fileimage[offset], nbytestowrite);
if (nbyteswritten < 0)
{
int err = errno;
int errcode = errno;
/* If the write failed because there is no space on the device,
* then don't complain.
*/
if (err != ENOSPC)
if (errcode != ENOSPC)
{
printf("ERROR: Failed to write file: %d\n", err);
printf("ERROR: Failed to write file: %d\n", errcode);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" Write offset: %ld\n", (long)offset);
printf(" Write size: %ld\n", (long)nbytestowrite);
ret = ERROR;
}
close(fd);
/* Remove any garbage file that might have been left behind */

View File

@ -133,3 +133,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -58,25 +58,14 @@
// Debug ********************************************************************
// Non-standard debug that may be enabled just for testing the constructors
#ifndef CONFIG_DEBUG
#ifndef CONFIG_DEBUG_FEATURES
# undef CONFIG_DEBUG_CXX
#endif
#ifdef CONFIG_DEBUG_CXX
# define cxxdbg dbg
# define cxxlldbg lldbg
# ifdef CONFIG_DEBUG_VERBOSE
# define cxxvdbg vdbg
# define cxxllvdbg llvdbg
# else
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
# endif
# define cxxinfo _info
#else
# define cxxdbg(x...)
# define cxxlldbg(x...)
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
# define cxxinfo(x...)
#endif
//***************************************************************************
@ -88,17 +77,17 @@ class CHelloWorld
public:
CHelloWorld(void) : mSecret(42)
{
cxxdbg("Constructor: mSecret=%d\n", mSecret);
cxxinfo("Constructor: mSecret=%d\n", mSecret);
}
~CHelloWorld(void)
{
cxxdbg("Destructor\n");
cxxinfo("Destructor\n");
}
bool HelloWorld(void)
{
cxxdbg("HelloWorld: mSecret=%d\n", mSecret);
cxxinfo("HelloWorld: mSecret=%d\n", mSecret);
if (mSecret != 42)
{

View File

@ -37,6 +37,8 @@
# USB Host HID keyboard Example
APPNAME = hidkbd
ASRCS =
CSRCS =
MAINSRC = hidkbd_main.c

File diff suppressed because it is too large Load Diff

View File

@ -96,23 +96,23 @@ static int ltdc_init_surface(int lid, uint32_t mode)
if (!sur->layer)
{
dbg("up_ltdcgetlayer() failed\n");
_err("ERROR: up_ltdcgetlayer() failed\n");
return -1;
}
if (sur->layer->getvideoinfo(sur->layer, &sur->vinfo) != OK)
{
dbg("getvideoinfo() failed\n");
_err("ERROR: getvideoinfo() failed\n");
return -1;
}
if (sur->layer->getplaneinfo(sur->layer, 0, &sur->pinfo) != OK)
{
dbg("getplaneinfo() failed\n");
_err("ERROR: getplaneinfo() failed\n");
return -1;
}
dbg("layer %d is configured with: xres = %d, yres = %d,"
_info("layer %d is configured with: xres = %d, yres = %d,"
"fb start address = %p, fb size = %d, fmt = %d, bpp = %d\n",
lid, sur->vinfo.xres, sur->vinfo.yres, sur->pinfo.fbmem, sur->pinfo.fblen,
sur->vinfo.fmt, sur->pinfo.bpp);
@ -133,7 +133,7 @@ static int ltdc_init_surface(int lid, uint32_t mode)
if (sur->layer->getlid(sur->layer, &lid, LTDC_LAYER_DMA2D) != OK)
{
dbg("getlid() failed\n");
_err("ERROR: getlid() failed\n");
return -1;
}
@ -141,7 +141,7 @@ static int ltdc_init_surface(int lid, uint32_t mode)
if (sur->dma2d == NULL)
{
dbg("up_dma2dgetlayer() failed\n");
_err("ERROR: up_dma2dgetlayer() failed\n");
return -1;
}
#endif
@ -168,7 +168,7 @@ static void ltdc_setget_test(void)
FAR struct ltdc_area_s area;
FAR struct surface *sur = ltdc_get_surface(LTDC_LAYER_ACTIVE);
dbg("Perform set and get test\n");
_info("Perform set and get test\n");
/* setalpha */
@ -176,14 +176,14 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setalpha() failed\n");
_err("ERROR: setalpha() failed\n");
}
ret = sur->layer->getalpha(sur->layer, &alpha);
if (ret != OK || alpha != 0x7f)
{
dbg("getalpha() failed\n");
_err("ERROR: getalpha() failed\n");
}
/* setcolor */
@ -192,14 +192,14 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setcolor() failed\n");
_err("ERROR: setcolor() failed\n");
}
ret = sur->layer->getcolor(sur->layer, &color);
if (ret != OK || color != 0x11223344)
{
dbg("getcolor() failed\n");
_err("ERROR: getcolor() failed\n");
}
/* setcolorkey */
@ -208,14 +208,14 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setcolorkey() failed\n");
_err("ERROR: setcolorkey() failed\n");
}
ret = sur->layer->getcolorkey(sur->layer, &color);
if (ret != OK || color != 0x55667788)
{
dbg("getcolorkey() failed\n");
_err("ERROR: getcolorkey() failed\n");
}
/* setblendmode */
@ -224,14 +224,14 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setblendmode() failed\n");
_err("ERROR: setblendmode() failed\n");
}
ret = sur->layer->getblendmode(sur->layer, &mode);
if (ret != OK || mode != LTDC_BLEND_NONE)
{
dbg("getblendmode() failed\n");
_err("ERROR: getblendmode() failed\n");
}
/* setarea */
@ -246,7 +246,7 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setarea() failed\n");
_err("ERROR: setarea() failed\n");
}
ret = sur->layer->getarea(sur->layer, &area, &xpos, &ypos);
@ -255,7 +255,7 @@ static void ltdc_setget_test(void)
area.xpos != sur->vinfo.xres/4 || area.ypos != sur->vinfo.yres/4 ||
area.xres != sur->vinfo.xres/2 || area.yres != sur->vinfo.yres/2)
{
dbg("getarea() failed\n");
_err("ERROR: getarea() failed\n");
}
#ifdef CONFIG_FB_CMAP
@ -275,7 +275,7 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setclut() failed\n");
_err("ERROR: setclut() failed\n");
}
/* Clear all colors to black */
@ -291,7 +291,7 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("getclut() failed\n");
_err("ERROR: getclut() failed\n");
}
#ifdef CONFIG_FB_TRANSPARENCY
@ -305,7 +305,7 @@ static void ltdc_setget_test(void)
ltdc_cmpcolor(g_cmap.green, cmap->green, LTDC_EXAMPLE_NCOLORS))
#endif
{
dbg("getclut() failed, unexpected cmap content\n");
_err("ERROR: getclut() failed, unexpected cmap content\n");
}
ltdc_deletecmap(cmap);
@ -318,7 +318,7 @@ static void ltdc_setget_test(void)
if (ret != OK)
{
dbg("setclut() failed\n");
_err("ERROR: setclut() failed\n");
}
}
#endif
@ -363,22 +363,22 @@ static void ltdc_color_test(void)
/* Default Color black */
dbg("Set default color to black\n");
_info("Set default color to black\n");
sur->layer->setcolor(sur->layer, 0xff000000);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
/* Set active layer to the upper half of the screen */
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer, should be black outside the colorful rectangle\n");
_info("Update the layer, should be black outside the colorful rectangle\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -386,11 +386,11 @@ static void ltdc_color_test(void)
/* Default Color red */
dbg("Update the layer, should be red outside the colorful rectangle\n");
_info("Update the layer, should be red outside the colorful rectangle\n");
sur->layer->setcolor(sur->layer, 0xffff0000);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -398,11 +398,11 @@ static void ltdc_color_test(void)
/* Default Color green */
dbg("Update the layer, should be green outside the colorful rectangle\n");
_info("Update the layer, should be green outside the colorful rectangle\n");
sur->layer->setcolor(sur->layer, 0xff00ff00);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -410,11 +410,11 @@ static void ltdc_color_test(void)
/* Default Color blue */
dbg("Update the layer, should be blue outside the colorful rectangle\n");
_info("Update the layer, should be blue outside the colorful rectangle\n");
sur->layer->setcolor(sur->layer, 0xff0000ff);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -427,18 +427,18 @@ static void ltdc_color_test(void)
area.xres = sur->vinfo.xres;
area.yres = sur->vinfo.yres;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
/* Default Color black */
dbg("Set default color to black\n");
_info("Set default color to black\n");
sur->layer->setcolor(sur->layer, 0);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -468,7 +468,7 @@ static void ltdc_colorkey_test(void)
/* Resize active layer */
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
@ -479,11 +479,11 @@ static void ltdc_colorkey_test(void)
/* Color key white */
dbg("Set colorkey to white\n");
_info("Set colorkey to white\n");
sur->layer->setcolorkey(sur->layer, 0xffffff);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -491,11 +491,11 @@ static void ltdc_colorkey_test(void)
/* Color key red */
dbg("Set colorkey to red\n");
_info("Set colorkey to red\n");
sur->layer->setcolorkey(sur->layer, 0xff0000);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -503,11 +503,11 @@ static void ltdc_colorkey_test(void)
/* Color key green */
dbg("Set colorkey to green\n");
_info("Set colorkey to green\n");
sur->layer->setcolorkey(sur->layer, 0xff00);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -515,15 +515,15 @@ static void ltdc_colorkey_test(void)
/* Color key red */
dbg("Set colorkey to blue\n");
_info("Set colorkey to blue\n");
sur->layer->setcolorkey(sur->layer, 0xff);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
dbg("Disable colorkey\n");
_info("Disable colorkey\n");
usleep(1000000);
@ -536,7 +536,7 @@ static void ltdc_colorkey_test(void)
area.xres = sur->vinfo.xres;
area.yres = sur->vinfo.yres;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, 0, 0);
@ -545,7 +545,7 @@ static void ltdc_colorkey_test(void)
sur->layer->setblendmode(sur->layer, LTDC_BLEND_NONE);
dbg("Update the layer\n");
_info("Update the layer\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK|LTDC_SYNC_WAIT);
@ -568,7 +568,7 @@ static void ltdc_area_test(void)
struct ltdc_area_s area;
FAR struct surface *sur = ltdc_get_surface(LTDC_LAYER_ACTIVE);
dbg("Perform area test\n");
_info("Perform area test\n");
ltdc_simple_draw(&sur->vinfo, &sur->pinfo);
@ -581,12 +581,12 @@ static void ltdc_area_test(void)
area.xres = sur->vinfo.xres/2;
area.yres = sur->vinfo.yres/2;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer, to show the upper left rectangle of the screen\n");
_info("Update the layer, to show the upper left rectangle of the screen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -599,12 +599,12 @@ static void ltdc_area_test(void)
area.xres = sur->vinfo.xres/2;
area.yres = sur->vinfo.yres/2;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer, to show the upper right rectangle of the screen\n");
_info("Update the layer, to show the upper right rectangle of the screen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -617,12 +617,12 @@ static void ltdc_area_test(void)
area.xres = sur->vinfo.xres/2;
area.yres = sur->vinfo.yres/2;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer, to show the lower left rectangle of the screen\n");
_info("Update the layer, to show the lower left rectangle of the screen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -635,12 +635,12 @@ static void ltdc_area_test(void)
area.xres = sur->vinfo.xres/2;
area.yres = sur->vinfo.yres/2;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer, to show the lower right rectangle of the screen\n");
_info("Update the layer, to show the lower right rectangle of the screen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -648,7 +648,7 @@ static void ltdc_area_test(void)
/* Perform layer positioning */
dbg("Perform positioning test\n");
_info("Perform positioning test\n");
/* Set layer in the middle of the screen */
@ -712,7 +712,7 @@ static void ltdc_area_test(void)
/* Perform move */
dbg("Perform move test\n");
_info("Perform move test\n");
/* Set layer in the middle of the screen */
@ -786,7 +786,7 @@ static void ltdc_area_test(void)
/* Perform Reference position */
dbg("Perform reference positioning test\n");
_info("Perform reference positioning test\n");
/* Set layer in the middle of the screen */
@ -862,12 +862,12 @@ static void ltdc_area_test(void)
area.xres = sur->vinfo.xres;
area.yres = sur->vinfo.yres;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
dbg("Update the layer to fullscreen\n");
_info("Update the layer to fullscreen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -893,7 +893,7 @@ static void ltdc_common_test(void)
struct ltdc_area_s area;
FAR struct surface *sur;
dbg("Set layer 2 to the active layer, blend with subjacent layer 1\n");
_info("Set layer 2 to the active layer, blend with subjacent layer 1\n");
sur = ltdc_get_surface(LTDC_LAYER_TOP);
@ -905,7 +905,7 @@ static void ltdc_common_test(void)
/* Perform area test */
dbg("Perform area test\n");
_info("Perform area test\n");
/* Set layer in the middle of the screen */
@ -1026,7 +1026,7 @@ static void ltdc_common_test(void)
/* Perform positioning test */
dbg("Perform positioning test\n");
_info("Perform positioning test\n");
/* Set layer in the middle of the screen */
@ -1145,7 +1145,7 @@ static void ltdc_common_test(void)
/* Perform Reference position */
dbg("Perform reference positioning test\n");
_info("Perform reference positioning test\n");
/* Set layer in the middle of the screen */
@ -1271,7 +1271,7 @@ static void ltdc_common_test(void)
area.xres = sur->vinfo.xres;
area.yres = sur->vinfo.yres;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
sur->layer->setarea(sur->layer, &area, area.xpos, area.ypos);
@ -1281,7 +1281,7 @@ static void ltdc_common_test(void)
sur->layer->setcolorkey(sur->layer, 0);
sur->layer->setblendmode(sur->layer, LTDC_BLEND_NONE);
dbg("Update the layer to fullscreen\n");
_info("Update the layer to fullscreen\n");
sur->layer->update(sur->layer, LTDC_SYNC_VBLANK);
@ -1306,16 +1306,16 @@ static void ltdc_alpha_blend_test(void)
/* Ensure operation on layer 2 */
dbg("Set layer 2 to the active layer, blend with subjacent layer 1\n");
_info("Set layer 2 to the active layer, blend with subjacent layer 1\n");
top = ltdc_get_surface(LTDC_LAYER_TOP);
bottom = ltdc_get_surface(LTDC_LAYER_BOTTOM);
dbg("top = %p, bottom = %p\n", top->pinfo.fbmem, bottom->pinfo.fbmem);
_info("top = %p, bottom = %p\n", top->pinfo.fbmem, bottom->pinfo.fbmem);
ltdc_simple_draw(&top->vinfo, &top->pinfo);
dbg("Fill layer1 with color black\n");
_info("Fill layer1 with color black\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
@ -1326,26 +1326,26 @@ static void ltdc_alpha_blend_test(void)
area.xres = top->vinfo.xres/2;
area.yres = top->vinfo.yres/2;
dbg("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
_info("Set area to xpos = %d, ypos = %d, xres = %d, yres = %d\n",
area.xpos, area.ypos, area.xres, area.yres);
top->layer->setarea(top->layer, &area, area.xpos, area.ypos);
dbg("Set alpha blending with bottom layer1\n");
_info("Set alpha blending with bottom layer1\n");
top->layer->setblendmode(top->layer, LTDC_BLEND_ALPHA);
dbg("Disable blending for bottom layer1 to make the layer color visible\n");
_info("Disable blending for bottom layer1 to make the layer color visible\n");
bottom->layer->setblendmode(bottom->layer, LTDC_BLEND_NONE);
bottom->layer->setalpha(bottom->layer, 0xff);
dbg("Fill bottom layer1 with color black\n");
_info("Fill bottom layer1 with color black\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
ltdc_color(&bottom->vinfo, LTDC_BLACK));
dbg("Blend in black subjacent layer\n");
_info("Blend in black subjacent layer\n");
for (i = 255; i >= 0; i--)
{
@ -1353,13 +1353,13 @@ static void ltdc_alpha_blend_test(void)
top->layer->update(top->layer, LTDC_UPDATE_SIM|LTDC_SYNC_VBLANK);
}
dbg("Fill bottom layer1 with color red\n");
_info("Fill bottom layer1 with color red\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
ltdc_color(&bottom->vinfo, LTDC_RED));
dbg("Blend in red subjacent layer\n");
_info("Blend in red subjacent layer\n");
for (i = 255; i >= 0; i--)
{
@ -1367,13 +1367,13 @@ static void ltdc_alpha_blend_test(void)
top->layer->update(top->layer, LTDC_UPDATE_SIM|LTDC_SYNC_VBLANK);
}
dbg("Fill bottom layer1 with color green\n");
_info("Fill bottom layer1 with color green\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
ltdc_color(&bottom->vinfo, LTDC_GREEN));
dbg("Blend in green subjacent layer\n");
_info("Blend in green subjacent layer\n");
for (i = 255; i >= 0; i--)
{
@ -1381,13 +1381,13 @@ static void ltdc_alpha_blend_test(void)
top->layer->update(top->layer, LTDC_UPDATE_SIM|LTDC_SYNC_VBLANK);
}
dbg("Fill bottom layer1 with color blue\n");
_info("Fill bottom layer1 with color blue\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
ltdc_color(&bottom->vinfo, LTDC_BLUE));
dbg("Blend in blue subjacent layer\n");
_info("Blend in blue subjacent layer\n");
for (i = 255; i >= 0; i--)
{
@ -1395,13 +1395,13 @@ static void ltdc_alpha_blend_test(void)
top->layer->update(top->layer, LTDC_UPDATE_SIM|LTDC_SYNC_VBLANK);
}
dbg("Fill bottom layer1 with color white\n");
_info("Fill bottom layer1 with color white\n");
ltdc_drawcolor(&bottom->vinfo, bottom->pinfo.fbmem,
bottom->vinfo.xres, bottom->vinfo.yres,
ltdc_color(&bottom->vinfo, LTDC_WHITE));
dbg("Blend in white subjacent layer\n");
_info("Blend in white subjacent layer\n");
for (i = 255; i >= 0; i--)
{
@ -1437,32 +1437,32 @@ static void ltdc_flip_test(void)
/* Flip with non blend */
dbg("Perform flip test without blending\n");
_info("Perform flip test without blending\n");
dbg("active->pinfo.fbmem = %p\n", active->pinfo.fbmem);
dbg("inactive->pinfo.fbmem = %p\n", inactive->pinfo.fbmem);
_info("active->pinfo.fbmem = %p\n", active->pinfo.fbmem);
_info("inactive->pinfo.fbmem = %p\n", inactive->pinfo.fbmem);
dbg("Ensure that both layer opaque\n");
_info("Ensure that both layer opaque\n");
active->layer->setalpha(active->layer, 0xff);
inactive->layer->setalpha(inactive->layer, 0xff);
active->layer->setblendmode(active->layer, LTDC_BLEND_NONE);
inactive->layer->setblendmode(inactive->layer, LTDC_BLEND_NONE);
dbg("Set the active layer to fullscreen black\n");
_info("Set the active layer to fullscreen black\n");
ltdc_drawcolor(&active->vinfo, active->pinfo.fbmem,
active->vinfo.xres, active->vinfo.yres,
ltdc_color(&active->vinfo, LTDC_BLACK));
usleep(1000000);
dbg("Set invisible layer to fullscreen blue\n");
_info("Set invisible layer to fullscreen blue\n");
ltdc_drawcolor(&inactive->vinfo, inactive->pinfo.fbmem,
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_BLUE));
usleep(1000000);
dbg("Flip layer to see the blue fullscreen\n");
_info("Flip layer to see the blue fullscreen\n");
inactive->layer->update(inactive->layer,
LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
@ -1470,41 +1470,41 @@ static void ltdc_flip_test(void)
/* Active layer is now inactive */
dbg("Set invisible layer to fullscreen green\n");
_info("Set invisible layer to fullscreen green\n");
ltdc_drawcolor(&active->vinfo, active->pinfo.fbmem,
active->vinfo.xres, active->vinfo.yres,
ltdc_color(&active->vinfo, LTDC_GREEN));
usleep(1000000);
dbg("Flip layer to see the green fullscreen\n");
_info("Flip layer to see the green fullscreen\n");
inactive->layer->update(inactive->layer,
LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
usleep(1000000);
dbg("Set invisible layer to fullscreen red\n");
_info("Set invisible layer to fullscreen red\n");
ltdc_drawcolor(&inactive->vinfo, inactive->pinfo.fbmem,
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_RED));
usleep(1000000);
dbg("Flip layer to see the red fullscreen\n");
_info("Flip layer to see the red fullscreen\n");
inactive->layer->update(inactive->layer, LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
usleep(1000000);
/* Flip with alpha blend */
dbg("Perform flip test with alpha blending\n");
_info("Perform flip test with alpha blending\n");
/* Set the bottom layer to the current active layer */
active = ltdc_get_surface(LTDC_LAYER_BOTTOM);
inactive = ltdc_get_surface(LTDC_LAYER_TOP);
dbg("Ensure that both layer fullscreen black\n");
_info("Ensure that both layer fullscreen black\n");
ltdc_drawcolor(&active->vinfo, active->pinfo.fbmem,
active->vinfo.xres, active->vinfo.yres,
ltdc_color(&active->vinfo, LTDC_BLACK));
@ -1512,15 +1512,15 @@ static void ltdc_flip_test(void)
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_BLACK));
dbg("Ensure that both layer semitransparent\n");
_info("Ensure that both layer semitransparent\n");
active->layer->setalpha(active->layer, 0x7f);
inactive->layer->setalpha(inactive->layer, 0x7f);
active->layer->setblendmode(active->layer, LTDC_BLEND_ALPHA);
inactive->layer->setblendmode(inactive->layer, LTDC_BLEND_ALPHA);
dbg("Enter in the flip mode sequence\n");
dbg("Set the bottom layer to the active layer\n");
dbg("Also update both layer simultaneous\n");
_info("Enter in the flip mode sequence\n");
_info("Set the bottom layer to the active layer\n");
_info("Also update both layer simultaneous\n");
active->layer->update(active->layer,LTDC_UPDATE_ACTIVATE|
LTDC_UPDATE_SIM|
LTDC_UPDATE_FLIP|
@ -1528,28 +1528,28 @@ static void ltdc_flip_test(void)
usleep(1000000);
dbg("Set invisible layer to fullscreen blue\n");
_info("Set invisible layer to fullscreen blue\n");
ltdc_drawcolor(&inactive->vinfo, inactive->pinfo.fbmem,
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_BLUE));
usleep(1000000);
dbg("Flip layer to see the blue fullscreen\n");
_info("Flip layer to see the blue fullscreen\n");
inactive->layer->update(active->layer, LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
usleep(1000000);
/* Active layer is top now */
dbg("Set invisible layer to fullscreen green\n");
_info("Set invisible layer to fullscreen green\n");
ltdc_drawcolor(&active->vinfo, active->pinfo.fbmem,
active->vinfo.xres, active->vinfo.yres,
ltdc_color(&active->vinfo, LTDC_GREEN));
usleep(1000000);
dbg("Flip layer to see the green fullscreen\n");
_info("Flip layer to see the green fullscreen\n");
inactive->layer->update(active->layer,
LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
@ -1557,32 +1557,32 @@ static void ltdc_flip_test(void)
/* Active layer is bottom now */
dbg("Set invisible layer to fullscreen red\n");
_info("Set invisible layer to fullscreen red\n");
ltdc_drawcolor(&inactive->vinfo, inactive->pinfo.fbmem,
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_RED));
usleep(1000000);
dbg("Flip layer to see the red fullscreen\n");
_info("Flip layer to see the red fullscreen\n");
inactive->layer->update(active->layer, LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
usleep(1000000);
/* Active layer is top now */
dbg("Set bottom layer back to fullscreen black\n");
_info("Set bottom layer back to fullscreen black\n");
ltdc_drawcolor(&active->vinfo, active->pinfo.fbmem,
active->vinfo.xres, active->vinfo.yres,
ltdc_color(&active->vinfo, LTDC_BLACK));
dbg("Set bottom layer to alpha %d and disable blend mode\n", 0xff);
_info("Set bottom layer to alpha %d and disable blend mode\n", 0xff);
inactive->layer->setalpha(active->layer, 0xff);
inactive->layer->setblendmode(active->layer, LTDC_BLEND_NONE);
usleep(1000000);
dbg("Flip layer to see the black fullscreen\n");
_info("Flip layer to see the black fullscreen\n");
inactive->layer->update(active->layer,
LTDC_UPDATE_FLIP|LTDC_SYNC_VBLANK);
@ -1596,16 +1596,16 @@ static void ltdc_flip_test(void)
/* Restore settings */
dbg("Finally set the top layer back to fullscreen black\n");
_info("Finally set the top layer back to fullscreen black\n");
ltdc_drawcolor(&inactive->vinfo, inactive->pinfo.fbmem,
inactive->vinfo.xres, inactive->vinfo.yres,
ltdc_color(&inactive->vinfo, LTDC_BLACK));
dbg("Set top layer to alpha %d and disable blend mode\n", 0xff);
_info("Set top layer to alpha %d and disable blend mode\n", 0xff);
inactive->layer->setalpha(inactive->layer, 0xff);
inactive->layer->setblendmode(inactive->layer, LTDC_BLEND_NONE);
dbg("Flip to the top layer\n");
_info("Flip to the top layer\n");
inactive->layer->update(inactive->layer,
LTDC_UPDATE_ACTIVATE|LTDC_SYNC_VBLANK);
@ -1728,7 +1728,7 @@ FAR struct fb_cmap_s * ltdc_createcmap(uint16_t ncolors)
if (!clut)
{
dbg("malloc() failed\n");
_err("ERROR: malloc() failed\n");
free(cmap);
return NULL;;
}
@ -1805,7 +1805,7 @@ uint32_t ltdc_color(FAR struct fb_videoinfo_s *vinfo, uint8_t color)
break;
#endif
default:
dbg("Unsupported pixel format %d\n", vinfo->fmt);
_err("ERROR: Unsupported pixel format %d\n", vinfo->fmt);
value = 0;
break;
}
@ -1828,8 +1828,8 @@ void ltdc_simple_draw(FAR struct fb_videoinfo_s *vinfo,
uint16_t xres = vinfo->xres;
uint16_t yres = vinfo->yres;
dbg("draw a red and green rectangle in the upper half\n");
dbg("draw a white and blue rectangle in the lower half\n");
_info("draw a red and green rectangle in the upper half\n");
_info("draw a white and blue rectangle in the lower half\n");
#if defined(CONFIG_STM32_LTDC_L1_L8) || defined(CONFIG_STM32_LTDC_L2_L8)
if (vinfo->fmt == FB_FMT_RGB8)
@ -1982,7 +1982,7 @@ void ltdc_drawcolor(FAR struct fb_videoinfo_s *vinfo, void *buffer,
/* draw a blue rectangle */
dbg("draw a full screen rectangle with color %08x\n", color);
_info("draw a full screen rectangle with color %08x\n", color);
#if defined(CONFIG_STM32_LTDC_L1_L8) || defined(CONFIG_STM32_LTDC_L2_L8)
if (vinfo->fmt == FB_FMT_RGB8)
@ -2059,13 +2059,13 @@ struct surface * ltdc_get_surface(uint32_t mode)
if (ret != OK)
{
dbg("getlid() failed\n");
_err("ERROR: getlid() failed\n");
_exit(1);
}
if (lid < 0 || lid > 1)
{
dbg("invalid layer id %d\n", lid);
_err("ERROR: invalid layer id %d\n", lid);
_exit(1);
}
@ -2086,7 +2086,7 @@ int ltdc_main(int argc, char *argv[])
if (up_fbinitialize(0) < 0)
{
dbg("up_fbinitialize() failed\n");
_err("ERROR: up_fbinitialize() failed\n");
return -1;
}
@ -2094,23 +2094,23 @@ int ltdc_main(int argc, char *argv[])
if (!fbtable)
{
dbg("up_fbgetvplane() failed\n");
_err("ERROR: up_fbgetvplane() failed\n");
return -1;
}
if (fbtable->getvideoinfo(fbtable, &vinfo)<0)
{
dbg("getvideoinfo failed\n");
_err("ERROR: getvideoinfo failed\n");
return -1;
}
if (fbtable->getplaneinfo(fbtable, 0, &pinfo)<0)
{
dbg("getplaneinfo failed\n");
_err("ERROR: getplaneinfo failed\n");
return -1;
}
dbg("fb is configured with: xres = %d, yres = %d, \
_info("fb is configured with: xres = %d, yres = %d, \
fb start address = %p, fb size = %d, fmt = %d, bpp = %d\n",
vinfo.xres, vinfo.yres, pinfo.fbmem, pinfo.fblen,
vinfo.fmt, pinfo.bpp);
@ -2122,7 +2122,7 @@ int ltdc_main(int argc, char *argv[])
{
if (fbtable->putcmap(fbtable, &g_cmap) != OK)
{
dbg("putcmap() failed\n");
_err("ERROR: putcmap() failed\n");
return -1;
}
}

View File

@ -49,6 +49,9 @@ config EXAMPLES_MEDIA_DEVPATH
ret = bchdev_register(/dev/mtdblock<N>, <path-to-character-driver>,
false);
NOTE: This drivr path can be overridden when the application is
executed by providing a differ device path on the 'media' command line.
config EXAMPLES_MEDIA_BLOCKSIZE
int "Block size"
default 512

View File

@ -127,11 +127,12 @@ static void get_blocksize(int fd, FAR struct media_info_s *info)
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int media_main(int argc, char *argv[])
int media_main(int argc, FAR char *argv[])
#endif
{
FAR uint8_t *txbuffer;
FAR uint8_t *rxbuffer;
FAR char *devpath;
struct media_info_s info;
ssize_t nwritten;
ssize_t nread;
@ -145,14 +146,23 @@ int media_main(int argc, char *argv[])
/* Open the character driver that wraps the media */
fd = open(CONFIG_EXAMPLES_MEDIA_DEVPATH, O_RDWR);
if (argc < 2)
{
devpath = CONFIG_EXAMPLES_MEDIA_DEVPATH;
}
else
{
devpath = argv[1];
}
fd = open(argv[1], O_RDWR);
if (fd < 0)
{
fprintf(stderr, "ERROR: failed to open %s: %d\n",
CONFIG_EXAMPLES_MEDIA_DEVPATH, errno);
devpath, errno);
return 1;
}
/* Get the block size to use */
get_blocksize(fd, &info);

View File

@ -37,6 +37,8 @@
# Memory Management Test
APPNAME = mm
ASRCS =
CSRCS =
MAINSRC = mm_main.c

View File

@ -153,3 +153,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -37,6 +37,8 @@
# mount() test
APPNAME = mount
ASRCS =
CSRCS = ramdisk.c
MAINSRC = mount_main.c

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examples/mtdpart/Makefile
#
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
# Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,7 +35,9 @@
-include $(TOPDIR)/Make.defs
# Hello, World! Example
# MTD Partition Example
APPNAME = mtdpart
ASRCS =
CSRCS =

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/mtdpart/mtdpart_main.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -127,10 +127,6 @@ static uint8_t g_simflash[MTDPART_BUFSIZE];
extern FAR struct mtd_dev_s *mtdpart_archinitialize(void);
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -218,7 +214,7 @@ int mtdpart_main(int argc, char *argv[])
ret = master->ioctl(master, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo));
if (ret < 0)
{
fdbg("ERROR: mtd->ioctl failed: %d\n", ret);
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
exit(3);
}

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examplex/mtdrwb/Makefile
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,7 +35,9 @@
-include $(TOPDIR)/Make.defs
# Hello, World! Example
# MTD R/W buffer test Example
APPNAME = mtdrwb
ASRCS =
CSRCS =

View File

@ -220,7 +220,7 @@ int mtdrwb_main(int argc, char *argv[])
ret = mtdrwb->ioctl(mtdrwb, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo));
if (ret < 0)
{
fdbg("ERROR: mtdrwb->ioctl failed: %d\n", ret);
ferr("ERROR: mtdrwb->ioctl failed: %d\n", ret);
exit(5);
}

View File

@ -187,3 +187,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -37,6 +37,8 @@
# NuttShell (NSH) Example
APPNAME = nsh
ASRCS =
CSRCS =
MAINSRC = nsh_main.c

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examples/nxffs/Makefile
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,7 +35,9 @@
-include $(TOPDIR)/Make.defs
# Hello, World! Example
# NXFFS file system example
APPNAME = nxffs
ASRCS =
CSRCS =

View File

@ -351,15 +351,15 @@ static inline int nxffs_wrfile(FAR struct nxffs_filedesc_s *file)
nbyteswritten = write(fd, &g_fileimage[offset], nbytestowrite);
if (nbyteswritten < 0)
{
int err = errno;
int errcode = errno;
/* If the write failed because there is no space on the device,
* then don't complain.
*/
if (err != ENOSPC)
if (errcode != ENOSPC)
{
printf("ERROR: Failed to write file: %d\n", err);
printf("ERROR: Failed to write file: %d\n", errcode);
printf(" File name: %s\n", file->name);
printf(" File size: %lu\n", (unsigned long)file->len);
printf(" Write offset: %ld\n", (long)offset);

View File

@ -127,3 +127,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -96,25 +96,25 @@
#define ROMFSDEV "/dev/ram0"
#define MOUNTPT "/mnt/romfs"
/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the
/* If CONFIG_DEBUG_FEATURES is enabled, use info/err instead of printf so that the
* output will be synchronous with the debug output.
*/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(format, ...) dbg(format, ##__VA_ARGS__)
# define err(format, ...) dbg(format, ##__VA_ARGS__)
# ifdef CONFIG_DEBUG_FEATURES
# define message(format, ...) _info(format, ##__VA_ARGS__)
# define errmsg(format, ...) _err(format, ##__VA_ARGS__)
# else
# define message(format, ...) printf(format, ##__VA_ARGS__)
# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message dbg
# define err dbg
# ifdef CONFIG_DEBUG_FEATURES
# define message _info
# define errmsg _err
# else
# define message printf
# define err printf
# define errmsg printf
# endif
#endif
@ -170,7 +170,7 @@ int nxflat_main(int argc, char *argv[])
ret = nxflat_initialize();
if (ret < 0)
{
err("ERROR: Initialization of the NXFLAT loader failed: %d\n", ret);
errmsg("ERROR: Initialization of the NXFLAT loader failed: %d\n", ret);
exit(1);
}
@ -180,7 +180,7 @@ int nxflat_main(int argc, char *argv[])
ret = romdisk_register(0, (FAR uint8_t *)romfs_img, NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
err("ERROR: romdisk_register failed: %d\n", ret);
errmsg("ERROR: romdisk_register failed: %d\n", ret);
nxflat_uninitialize();
exit(1);
}
@ -193,8 +193,8 @@ int nxflat_main(int argc, char *argv[])
ret = mount(ROMFSDEV, MOUNTPT, "romfs", MS_RDONLY, NULL);
if (ret < 0)
{
err("ERROR: mount(%s,%s,romfs) failed: %s\n",
ROMFSDEV, MOUNTPT, errno);
errmsg("ERROR: mount(%s,%s,romfs) failed: %s\n",
ROMFSDEV, MOUNTPT, errno);
nxflat_uninitialize();
}
@ -241,7 +241,7 @@ int nxflat_main(int argc, char *argv[])
ret = load_module(&bin);
if (ret < 0)
{
err("ERROR: Failed to load program '%s'\n", dirlist[i]);
errmsg("ERROR: Failed to load program '%s'\n", dirlist[i]);
exit(1);
}
@ -250,7 +250,7 @@ int nxflat_main(int argc, char *argv[])
ret = exec_module(&bin);
if (ret < 0)
{
err("ERROR: Failed to execute program '%s'\n", dirlist[i]);
errmsg("ERROR: Failed to execute program '%s'\n", dirlist[i]);
unload_module(&bin);
}

View File

@ -34,7 +34,7 @@
############################################################################
-include $(TOPDIR)/.config # Current configuration
-include $(TOPDIR)/Make.defs # Basic make info
-include $(TOPDIR)/Make.defs # Basic make _info
BIN = pthread

View File

@ -139,7 +139,7 @@ const struct nx_callback_s g_nxhellocb =
static void nxhello_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
}
@ -155,7 +155,7 @@ static void nxhello_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
{
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -174,7 +174,7 @@ static void nxhello_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_nxhello.havepos = true;
sem_post(&g_nxhello.sem);
gvdbg("Have xres=%d yres=%d\n", g_nxhello.xres, g_nxhello.yres);
ginfo("Have xres=%d yres=%d\n", g_nxhello.xres, g_nxhello.yres);
}
}
@ -199,7 +199,7 @@ static void nxhello_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nxhello_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
/* In this example, there is no keyboard so a keyboard event is not
* expected.

View File

@ -180,7 +180,7 @@ const struct nx_callback_s g_nximagecb =
static void nximage_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
}
@ -200,7 +200,7 @@ static void nximage_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
{
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -219,7 +219,7 @@ static void nximage_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_nximage.havepos = true;
sem_post(&g_nximage.sem);
gvdbg("Have xres=%d yres=%d\n", g_nximage.xres, g_nximage.yres);
ginfo("Have xres=%d yres=%d\n", g_nximage.xres, g_nximage.yres);
}
}
@ -252,7 +252,7 @@ static void nximage_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nximage_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
/* In this example, there is no keyboard so a keyboard event is not
* expected.

View File

@ -127,7 +127,7 @@ const struct nx_callback_s g_nxlinescb =
static void nxlines_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
}
@ -143,7 +143,7 @@ static void nxlines_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
{
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -162,7 +162,7 @@ static void nxlines_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_nxlines.havepos = true;
sem_post(&g_nxlines.sem);
gvdbg("Have xres=%d yres=%d\n", g_nxlines.xres, g_nxlines.yres);
ginfo("Have xres=%d yres=%d\n", g_nxlines.xres, g_nxlines.yres);
}
}
@ -187,7 +187,7 @@ static void nxlines_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nxlines_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
/* In this example, there is no keyboard so a keyboard event is not
* expected.

View File

@ -157,7 +157,7 @@ int nxterm_server(int argc, char *argv[])
/* Then start the server */
ret = nx_run(dev);
gvdbg("nx_run returned: %d\n", errno);
ginfo("nx_run returned: %d\n", errno);
return 3;
}

View File

@ -117,7 +117,7 @@ static void nxtool_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES];
int ret;
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
@ -125,7 +125,7 @@ static void nxtool_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
ret = nxtk_filltoolbar(hwnd, rect, color);
if (ret < 0)
{
gdbg("nxtk_filltoolbar failed: %d\n", errno);
gerr("ERROR: nxtk_filltoolbar failed: %d\n", errno);
}
}
@ -138,7 +138,7 @@ static void nxtool_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
FAR const struct nxgl_rect_s *bounds,
FAR void *arg)
{
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
}
@ -151,7 +151,7 @@ static void nxtool_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
static void nxtool_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
uint8_t buttons, FAR void *arg)
{
gvdbg("hwnd=%p pos=(%d,%d) button=%02x\n", hwnd, pos->x, pos->y, buttons);
ginfo("hwnd=%p pos=(%d,%d) button=%02x\n", hwnd, pos->x, pos->y, buttons);
}
#endif
@ -163,7 +163,7 @@ static void nxtool_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nxtool_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
}
#endif

View File

@ -117,7 +117,7 @@ static void nxwndo_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
{
nxgl_mxpixel_t wcolor[CONFIG_NX_NPLANES];
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
@ -149,7 +149,7 @@ static void nxwndo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
{
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -173,7 +173,7 @@ static void nxwndo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
g_nxterm_vars.haveres = true;
sem_post(&g_nxterm_vars.eventsem);
gvdbg("Have xres=%d yres=%d\n", g_nxterm_vars.xres, g_nxterm_vars.yres);
ginfo("Have xres=%d yres=%d\n", g_nxterm_vars.xres, g_nxterm_vars.yres);
}
}
@ -185,7 +185,7 @@ static void nxwndo_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
static void nxwndo_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
uint8_t buttons, FAR void *arg)
{
gvdbg("hwnd=%p pos=(%d,%d) button=%02x\n",
ginfo("hwnd=%p pos=(%d,%d) button=%02x\n",
hwnd, pos->x, pos->y, buttons);
}
#endif
@ -198,7 +198,7 @@ static void nxwndo_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nxwndo_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
(void)write(1, ch, nch);
}
#endif

View File

@ -147,7 +147,7 @@ static void nxbg_redrawrect(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect)
static void nxbg_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
@ -167,7 +167,7 @@ static void nxbg_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -191,7 +191,7 @@ static void nxbg_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
b_haveresolution = true;
sem_post(&g_semevent);
gvdbg("Have xres=%d yres=%d\n", g_xres, g_yres);
ginfo("Have xres=%d yres=%d\n", g_xres, g_yres);
}
}
@ -216,7 +216,7 @@ static void nxbg_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
static void nxbg_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
nxbg_write(hwnd, ch, nch);
}
#endif

View File

@ -211,7 +211,7 @@ static void nxpu_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
bool more, FAR void *arg)
{
FAR struct nxtext_state_s *st = (FAR struct nxtext_state_s *)arg;
gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%s\n",
hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y,
more ? "true" : "false");
@ -231,7 +231,7 @@ static void nxpu_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
/* Report the position */
gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)}\n",
hwnd, size->w, size->h, pos->x, pos->y,
bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y);
@ -280,7 +280,7 @@ static void nxpu_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
FAR void *arg)
{
FAR struct nxtext_state_s *st = (FAR struct nxtext_state_s *)arg;
gvdbg("hwnd=%p nch=%d\n", hwnd, nch);
ginfo("hwnd=%p nch=%d\n", hwnd, nch);
nxpu_puts(hwnd, st, nch, ch);
}
#endif
@ -345,7 +345,7 @@ NXWINDOW nxpu_open(void)
nxpu_initstate();
hwnd = nx_openwindow(g_hnx, &g_pucb, (FAR void *)&g_pustate);
gvdbg("hwnd=%p\n", hwnd);
ginfo("hwnd=%p\n", hwnd);
if (!hwnd)
{
@ -375,7 +375,7 @@ NXWINDOW nxpu_open(void)
/* Set the size of the pop-up window */
gvdbg("Set pop-up size to (%d,%d)\n", size.w, size.h);
ginfo("Set pop-up size to (%d,%d)\n", size.w, size.h);
ret = nxpu_setsize(hwnd, &size);
if (ret < 0)
{

View File

@ -233,7 +233,7 @@ nxtext_renderglyph(FAR struct nxtext_state_s *st,
/* Make sure that there is room for another glyph */
gvdbg("ch=%c [%02x]\n", isprint(ch) ? ch : '.', ch);
ginfo("ch=%c [%02x]\n", isprint(ch) ? ch : '.', ch);
/* Allocate the glyph (always succeeds) */

View File

@ -160,7 +160,7 @@ int nxtext_server(int argc, char *argv[])
/* Then start the server */
ret = nx_run(dev);
gvdbg("nx_run returned: %d\n", errno);
ginfo("nx_run returned: %d\n", errno);
return 3;
}

View File

@ -73,7 +73,7 @@
/* Priority inheritance */
#if defined(CONFIG_DEBUG) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
# define dump_nfreeholders(s) printf(s " nfreeholders: %d\n", sem_nfreeholders())
#else
# define dump_nfreeholders(s)
@ -215,7 +215,7 @@ int vfork_test(void);
* priority inheritance
*/
#if defined(CONFIG_DEBUG) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_PRIORITY_INHERITANCE) && defined(CONFIG_SEM_PHDEBUG)
void sem_enumholders(FAR sem_t *sem);
int sem_nfreeholders(void);
#else

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/ostest/posixtimer.c
*
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -258,7 +258,7 @@ errorout:
/* Detach the signal handler */
act.sa_sigaction = SIG_DFL;
act.sa_handler = SIG_DFL;
status = sigaction(MY_TIMER_SIGNAL, &act, &oact);
printf("timer_test: done\n" );

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/examples/ostest/sighand.c
*
* Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2008, 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -213,7 +213,7 @@ static int waiter_main(int argc, char *argv[])
/* Detach the signal handler */
act.sa_sigaction = SIG_DFL;
act.sa_handler = SIG_DFL;
(void)sigaction(WAKEUP_SIGNAL, &act, &oact);
printf("waiter_main: done\n" );
@ -331,7 +331,7 @@ void sighand_test(void)
/* Detach the signal handler */
#ifdef CONFIG_SCHED_HAVE_PARENT
act.sa_sigaction = SIG_DFL;
act.sa_handler = SIG_DFL;
(void)sigaction(SIGCHLD, &act, &oact);
#endif

View File

@ -37,6 +37,8 @@
# Pascal Add-On Example
APPNAME = pashello
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif

View File

@ -98,7 +98,7 @@ int pca9635_main(int argc, char *argv[])
ret = ioctl(fd, PWMIOC_SETLED_BRIGHTNESS, (unsigned long)&ledbright);
if (ret < 0)
{
dbg("ERROR: ioctl(PWMIOC_SETLED_BRIGHTNESS) failed: %d\n", errno);
_err("ERROR: ioctl(PWMIOC_SETLED_BRIGHTNESS) failed: %d\n", errno);
}
}

View File

@ -37,6 +37,8 @@
# Pipe Example
APPNAME = pipe
ASRCS =
CSRCS = transfer_test.c interlock_test.c redirect_test.c
MAINSRC = pipe_main.c

View File

@ -125,3 +125,5 @@ distclean: clean
$(call DELFILE, *.dSYM)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -156,3 +156,5 @@ spawn_main.o: spawn_main.c \
symtab.o: filesystem/symtab.c \
$(TOPDIR)/include/nuttx/compiler.h \
$(TOPDIR)/include/nuttx/binfmt/symtab.h
.PHONY: preconfig
preconfig:

View File

@ -103,25 +103,25 @@
# define CONFIG_EXAMPLES_ELF_DEVPATH "/dev/ram0"
#endif
/* If CONFIG_DEBUG is enabled, use dbg instead of printf so that the
/* If CONFIG_DEBUG_FEATURES is enabled, use info/err instead of printf so that the
* output will be synchronous with the debug output.
*/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(format, ...) dbg(format, ##__VA_ARGS__)
# define err(format, ...) dbg(format, ##__VA_ARGS__)
# ifdef CONFIG_DEBUG_FEATURES
# define message(format, ...) _info(format, ##__VA_ARGS__)
# define errmsg(format, ...) _err(format, ##__VA_ARGS__)
# else
# define message(format, ...) printf(format, ##__VA_ARGS__)
# define err(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# define errmsg(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message dbg
# define err dbg
# ifdef CONFIG_DEBUG_FEATURES
# define message _info
# define errmsg _err
# else
# define message printf
# define err printf
# define errmsg printf
# endif
#endif
@ -244,7 +244,7 @@ int spawn_main(int argc, char *argv[])
ret = elf_initialize();
if (ret < 0)
{
err("ERROR: Initialization of the ELF loader failed: %d\n", ret);
errmsg("ERROR: Initialization of the ELF loader failed: %d\n", ret);
exit(1);
}
@ -257,7 +257,7 @@ int spawn_main(int argc, char *argv[])
NSECTORS(romfs_img_len), SECTORSIZE);
if (ret < 0)
{
err("ERROR: romdisk_register failed: %d\n", ret);
errmsg("ERROR: romdisk_register failed: %d\n", ret);
elf_uninitialize();
exit(1);
}
@ -272,8 +272,8 @@ int spawn_main(int argc, char *argv[])
ret = mount(CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, "romfs", MS_RDONLY, NULL);
if (ret < 0)
{
err("ERROR: mount(%s,%s,romfs) failed: %s\n",
CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, errno);
errmsg("ERROR: mount(%s,%s,romfs) failed: %s\n",
CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, errno);
elf_uninitialize();
}
@ -307,14 +307,14 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_init(&file_actions);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_init failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_init failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
ret = posix_spawnattr_init(&attr);
if (ret != 0)
{
err("ERROR: posix_spawnattr_init failed: %d\n", ret);
errmsg("ERROR: posix_spawnattr_init failed: %d\n", ret);
}
posix_spawnattr_dump(&attr);
@ -340,7 +340,7 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn(&pid, filepath, &file_actions, &attr, NULL, (FAR char * const*)&g_argv);
if (ret != 0)
{
err("ERROR: posix_spawn failed: %d\n", ret);
errmsg("ERROR: posix_spawn failed: %d\n", ret);
}
sleep(4);
@ -351,14 +351,14 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_destroy(&file_actions);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_destroy failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_destroy failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
ret = posix_spawnattr_destroy(&attr);
if (ret != 0)
{
err("ERROR: posix_spawnattr_destroy failed: %d\n", ret);
errmsg("ERROR: posix_spawnattr_destroy failed: %d\n", ret);
}
posix_spawnattr_dump(&attr);
@ -379,14 +379,14 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_init(&file_actions);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_init failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_init failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
ret = posix_spawnattr_init(&attr);
if (ret != 0)
{
err("ERROR: posix_spawnattr_init failed: %d\n", ret);
errmsg("ERROR: posix_spawnattr_init failed: %d\n", ret);
}
posix_spawnattr_dump(&attr);
@ -397,7 +397,7 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_addclose(&file_actions, 0);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_addclose failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_addclose failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
@ -405,7 +405,7 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_addopen(&file_actions, 0, fullpath, O_RDONLY, 0644);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_addopen failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_addopen failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
@ -431,7 +431,7 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn(&pid, filepath, &file_actions, &attr, NULL, NULL);
if (ret != 0)
{
err("ERROR: posix_spawn failed: %d\n", ret);
errmsg("ERROR: posix_spawn failed: %d\n", ret);
}
sleep(2);
@ -442,14 +442,14 @@ int spawn_main(int argc, char *argv[])
ret = posix_spawn_file_actions_destroy(&file_actions);
if (ret != 0)
{
err("ERROR: posix_spawn_file_actions_destroy failed: %d\n", ret);
errmsg("ERROR: posix_spawn_file_actions_destroy failed: %d\n", ret);
}
posix_spawn_file_actions_dump(&file_actions);
ret = posix_spawnattr_destroy(&attr);
if (ret != 0)
{
err("ERROR: posix_spawnattr_destroy failed: %d\n", ret);
errmsg("ERROR: posix_spawnattr_destroy failed: %d\n", ret);
}
posix_spawnattr_dump(&attr);

View File

@ -37,6 +37,8 @@
# The smallest thing you can build -- the NULL example.
APPNAME = rgmp
ASRCS =
CSRCS =
MAINSRC = rgmp_main.c

View File

@ -153,3 +153,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -37,6 +37,8 @@
# Sendmail SMTP Example
APPNAME = sendmail
ASRCS =
CSRCS =
MAINSRC = sendmail_main.c

View File

@ -37,6 +37,8 @@
# Mindlessly simple console loopack test
APPNAME = serloop
ASRCS =
CSRCS =
MAINSRC = serloop_main.c

View File

@ -37,6 +37,8 @@
# SMART file system stress test
APPNAME = smart
ASRCS =
CSRCS =
MAINSRC = smart_main.c

View File

@ -356,21 +356,22 @@ static inline int smart_wrfile(FAR struct smart_filedesc_s *file)
nbyteswritten = write(fd, &g_fileimage[offset], nbytestowrite);
if (nbyteswritten < 0)
{
int err = errno;
int errcode = errno;
/* If the write failed because there is no space on the device,
* then don't complain.
*/
if (err != ENOSPC)
if (errcode != ENOSPC)
{
printf("ERROR: Failed to write file: %d\n", err);
printf("ERROR: Failed to write file: %d\n", errcode);
printf(" File name: %s\n", file->name);
printf(" File size: %d\n", file->len);
printf(" Write offset: %ld\n", (long)offset);
printf(" Write size: %ld\n", (long)nbytestowrite);
ret = ERROR;
}
close(fd);
/* Remove any garbage file that might have been left behind */

View File

@ -224,7 +224,7 @@ static int tcpecho_server(void)
return ERROR;
}
ndbg("start listening on port: %d\n", CONFIG_EXAMPLES_TCPECHO_PORT);
ninfo("start listening on port: %d\n", CONFIG_EXAMPLES_TCPECHO_PORT);
ret = listen(listenfd, CONFIG_EXAMPLES_TCPECHO_BACKLOG);
if (ret < 0)
@ -253,7 +253,7 @@ static int tcpecho_server(void)
clilen = sizeof(cliaddr);
connfd = accept(listenfd, (struct sockaddr*)&cliaddr, &clilen);
ndbg("new client: %s\n", inet_ntoa(cliaddr.sin_addr));
ninfo("new client: %s\n", inet_ntoa(cliaddr.sin_addr));
for (i = 1; i < CONFIG_EXAMPLES_TCPECHO_NCONN; i++)
{
@ -299,7 +299,7 @@ static int tcpecho_server(void)
{
/* connection reset by client */
ndbg("client[%d] aborted connection\n", i);
nwarn("WARNING: client[%d] aborted connection\n", i);
close(sockfd);
client[i].fd = -1;
@ -315,7 +315,7 @@ static int tcpecho_server(void)
{
/* connection closed by client */
ndbg("client[%d] closed connection\n", i);
nwarn("WARNING: client[%d] closed connection\n", i);
close(sockfd);
client[i].fd = -1;
@ -324,7 +324,7 @@ static int tcpecho_server(void)
{
if (strcmp(buf, "exit\r\n") == 0)
{
ndbg("client[%d] closed connection\n", i);
nwarn("WARNING: client[%d] closed connection\n", i);
close(sockfd);
client[i].fd = -1;
}

View File

@ -137,3 +137,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -138,3 +138,5 @@ distclean: clean
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -173,9 +173,9 @@ int tc_main(int argc, char *argv[])
#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE
/* Read one sample */
ivdbg("Reading...\n");
iinfo("Reading...\n");
nbytes = read(fd, &sample, sizeof(struct mouse_report_s));
ivdbg("Bytes read: %d\n", nbytes);
iinfo("Bytes read: %d\n", nbytes);
/* Handle unexpected return values */
@ -213,9 +213,9 @@ int tc_main(int argc, char *argv[])
#else
/* Read one sample */
ivdbg("Reading...\n");
iinfo("Reading...\n");
nbytes = read(fd, &sample, sizeof(struct touch_sample_s));
ivdbg("Bytes read: %d\n", nbytes);
iinfo("Bytes read: %d\n", nbytes);
/* Handle unexpected return values */

View File

@ -35,6 +35,8 @@
-include $(TOPDIR)/Make.defs
APPNAME = uavcan
MAINSRC = uavcan_main.cxx
CXXFLAGS += -I$(TOPDIR)/include/apps

View File

@ -179,3 +179,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -158,3 +158,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -167,3 +167,5 @@ distclean: clean
-include Make.dep
.PHONY: preconfig
preconfig:

Some files were not shown because too many files have changed in this diff Show More