Merged nuttx/apps into master

This commit is contained in:
ziggurat29 2016-05-30 11:56:00 -05:00
commit ff3ccba46e
63 changed files with 2387 additions and 251 deletions

View File

@ -90,7 +90,7 @@ endif
.built: $(OBJS) .built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS)) $(call ARCHIVE, $(BIN), $(OBJS))
$(Q) touch .built $(Q) touch $@
ifeq ($(CONFIG_BUILD_KERNEL),y) ifeq ($(CONFIG_BUILD_KERNEL),y)
$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) $(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ)

View File

@ -1583,4 +1583,19 @@
of the RTC driver (2016-04-03). of the RTC driver (2016-04-03).
* apps/examples/nximage: No configuration option to select * apps/examples/nximage: No configuration option to select
greyscale. greyscale.
* apps/canutils/uavcan: Update UAVCAN version. From Paul Alexander
Patience (2016-05-03)
* Several Makefiles: Add .PHONY definitions to prevent 'clean up to date'
message weirdness; Add default definitions for some commonly used
things when 'make clean' is used without .config or Make.defs files
installed (2016-05-10).
* apps/canutils/libcanard: Add libcanard UAVCAN library. From Paul
Alexander Patience (2016-05-12)
* apps/examples/watchdog: Remove call to up_wdginitialize(). This
interface should not be accessed from application code (2016-05-18).
* apps/system/sched_note: Move the schduler note monitor from examples/
to system/ (2016-05-18).
* apps/platform/nucleo-144: Add platform files for NUCLEO-144
(NUCLEO-F746ZG). From Mark Olsson (2016-05-19).
* apps/netutils/esp8266: ESP8266 driver application. From Pierre-noel
Bouteville (2016-05-21).

View File

@ -5,6 +5,7 @@
menu "CAN Utilities" menu "CAN Utilities"
source "$APPSDIR/canutils/uavcan/Kconfig" source "$APPSDIR/canutils/libcanard/Kconfig"
source "$APPSDIR/canutils/libuavcan/Kconfig"
endmenu # CAN Utilities endmenu # CAN Utilities

2
canutils/libcanard/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/.built
/libcanard-*

View File

@ -0,0 +1,27 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config CANUTILS_LIBCANARD
bool "libcanard UAVCAN Library"
default n
depends on CAN && CAN_EXTID
---help---
Enable the libcanard UAVCAN library.
if CANUTILS_LIBCANARD
config LIBCANARD_URL
string "libcanard URL"
default "https://github.com/UAVCAN/libcanard/archive"
---help---
libcanard URL.
config LIBCANARD_VERSION
string "libcanard Version"
default "34195e7f13637bdc79198c94bd1b2e5ecffe9383"
---help---
libcanard version.
endif

View File

@ -1,9 +1,9 @@
############################################################################ ############################################################################
# apps/examples/note/Make.defs # apps/canutils/libcanard/Make.defs
# Adds selected applications to apps/ build # Adds selected applications to apps/ build
# #
# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Copyright (C) 2016 Omni Hoverboards Inc. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
@ -34,6 +34,6 @@
# #
############################################################################ ############################################################################
ifeq ($(CONFIG_EXAMPLES_NOTE),y) ifeq ($(CONFIG_CANUTILS_LIBCANARD),y)
CONFIGURED_APPS += examples/sched_note CONFIGURED_APPS += canutils/libcanard
endif endif

111
canutils/libcanard/Makefile Normal file
View File

@ -0,0 +1,111 @@
############################################################################
# apps/canutils/libcanard/Makefile
#
# Copyright (C) 2016 Omni Hoverboards Inc. All rights reserved.
# Authors: Paul Alexander Patience <paul-a.patience@polymtl.ca>
#
# 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
include $(APPDIR)/Make.defs
WGET = wget
UNPACK = unzip
PACKEXT = .zip
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
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(CSRCS)
OBJS = $(COBJS)
ifeq ($(WINTOOL),y)
BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}"
else
BIN = $(APPDIR)$(DELIM)libapps$(LIBEXT)
endif
ROOTDEPPATH = --dep-path .
VPATH =
all: .built
.PHONY: clean depend distclean
$(LIBCANARD_PACKNAME):
@echo "Downloading: $@"
$(Q) $(WGET) -O $@ $(LIBCANARD_URL)$(DELIM)$(LIBCANARD_VERSION)$(PACKEXT)
$(LIBCANARD_UNPACKNAME): $(LIBCANARD_PACKNAME)
@echo "Unpacking: $< -> $@"
$(Q) $(UNPACK) $<
$(Q) touch $@
$(LIBCANARD_SRCDIR)$(DELIM)canard.h: $(LIBCANARD_UNPACKNAME)
$(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h: $(LIBCANARD_SRCDIR)$(DELIM)canard.h
$(Q) cp $< $@
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
.built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS))
$(Q) touch $@
install:
context: $(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
$(call DELFILE, .built)
$(call CLEAN)
$(foreach OBJ, $(OBJS), $(call DELFILE, $(OBJ)))
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
$(call DELFILE, $(APPDIR)$(DELIM)include$(DELIM)canutils$(DELIM)canard.h)
$(call DELDIR, $(LIBCANARD_UNPACKNAME))
$(call DELFILE, $(LIBCANARD_PACKNAME))
-include Make.dep

View File

@ -3,8 +3,8 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config CANUTILS_UAVCAN config CANUTILS_LIBUAVCAN
bool "UAVCAN Library" bool "libuavcan Library"
default n default n
depends on STM32_HAVE_CAN1 depends on STM32_HAVE_CAN1
depends on !STM32_CAN1 depends on !STM32_CAN1
@ -14,47 +14,47 @@ config CANUTILS_UAVCAN
depends on HAVE_CXX depends on HAVE_CXX
depends on !DISABLE_POLL depends on !DISABLE_POLL
---help--- ---help---
Enables support for the UAVCAN library. Enables support for the libuavcan library.
if CANUTILS_UAVCAN if CANUTILS_LIBUAVCAN
config UAVCAN_LIBUAVCAN_URL config LIBUAVCAN_URL
string "UAVCAN URL" string "libuavcan URL"
default "https://github.com/UAVCAN/libuavcan/archive" default "https://github.com/UAVCAN/libuavcan/archive"
---help--- ---help---
UAVCAN URL. libuavcan URL.
config UAVCAN_LIBUAVCAN_VERSION config LIBUAVCAN_VERSION
string "UAVCAN Version" string "libuavcan Version"
default "c152f28a620ceec9f63581a7c99fe77c89938048" default "b04396ace50155573e545ed9bf2fb09964ee2367"
---help--- ---help---
UAVCAN version. libuavcan version.
config UAVCAN_DSDL_URL config LIBUAVCAN_DSDL_URL
string "DSDL URL" string "DSDL URL"
default "https://github.com/UAVCAN/dsdl/archive" default "https://github.com/UAVCAN/dsdl/archive"
---help--- ---help---
DSDL URL. DSDL URL.
config UAVCAN_DSDL_VERSION config LIBUAVCAN_DSDL_VERSION
string "DSDL Version" string "DSDL Version"
default "9804a3e6972825586be252ce08dd899f44994b14" default "9804a3e6972825586be252ce08dd899f44994b14"
---help--- ---help---
DSDL version. DSDL version.
config UAVCAN_PYUAVCAN_URL config LIBUAVCAN_PYUAVCAN_URL
string "Python UAVCAN URL" string "pyuavcan URL"
default "https://github.com/UAVCAN/pyuavcan/archive" default "https://github.com/UAVCAN/pyuavcan/archive"
---help--- ---help---
Python UAVCAN URL. pyuavcan URL.
config UAVCAN_PYUAVCAN_VERSION config LIBUAVCAN_PYUAVCAN_VERSION
string "Python UAVCAN Version" string "pyuavcan Version"
default "c58477a644d20ccf95a20c151f3a0402f271c3b8" default "c58477a644d20ccf95a20c151f3a0402f271c3b8"
---help--- ---help---
Python UAVCAN version. pyuavcan version.
config UAVCAN_STM32_NUM_IFACES config LIBUAVCAN_STM32_NUM_IFACES
int "Number of CAN Interfaces" int "Number of CAN Interfaces"
default 1 default 1
range 1 1 if !STM32_HAVE_CAN2 range 1 1 if !STM32_HAVE_CAN2
@ -62,44 +62,44 @@ config UAVCAN_STM32_NUM_IFACES
choice choice
prompt "Timer" prompt "Timer"
default UAVCAN_STM32_TIM2 if !STM32_TIM2 default LIBUAVCAN_STM32_TIM2 if !STM32_TIM2
default UAVCAN_STM32_TIM3 if STM32_HAVE_TIM3 && !STM32_TIM3 default LIBUAVCAN_STM32_TIM3 if STM32_HAVE_TIM3 && !STM32_TIM3
default UAVCAN_STM32_TIM4 if STM32_HAVE_TIM4 && !STM32_TIM4 default LIBUAVCAN_STM32_TIM4 if STM32_HAVE_TIM4 && !STM32_TIM4
default UAVCAN_STM32_TIM5 if STM32_HAVE_TIM5 && !STM32_TIM5 default LIBUAVCAN_STM32_TIM5 if STM32_HAVE_TIM5 && !STM32_TIM5
default UAVCAN_STM32_TIM6 if STM32_HAVE_TIM6 && !STM32_TIM6 default LIBUAVCAN_STM32_TIM6 if STM32_HAVE_TIM6 && !STM32_TIM6
default UAVCAN_STM32_TIM7 if STM32_HAVE_TIM7 && !STM32_TIM7 default LIBUAVCAN_STM32_TIM7 if STM32_HAVE_TIM7 && !STM32_TIM7
config UAVCAN_STM32_TIM2 config LIBUAVCAN_STM32_TIM2
bool "TIM2" bool "TIM2"
depends on !STM32_TIM2 depends on !STM32_TIM2
---help--- ---help---
The library will use TIM2. The library will use TIM2.
config UAVCAN_STM32_TIM3 config LIBUAVCAN_STM32_TIM3
bool "TIM3" bool "TIM3"
depends on STM32_HAVE_TIM3 && !STM32_TIM3 depends on STM32_HAVE_TIM3 && !STM32_TIM3
---help--- ---help---
The library will use TIM3. The library will use TIM3.
config UAVCAN_STM32_TIM4 config LIBUAVCAN_STM32_TIM4
bool "TIM4" bool "TIM4"
depends on STM32_HAVE_TIM4 && !STM32_TIM4 depends on STM32_HAVE_TIM4 && !STM32_TIM4
---help--- ---help---
The library will use TIM4. The library will use TIM4.
config UAVCAN_STM32_TIM5 config LIBUAVCAN_STM32_TIM5
bool "TIM5" bool "TIM5"
depends on STM32_HAVE_TIM5 && !STM32_TIM5 depends on STM32_HAVE_TIM5 && !STM32_TIM5
---help--- ---help---
The library will use TIM5. The library will use TIM5.
config UAVCAN_STM32_TIM6 config LIBUAVCAN_STM32_TIM6
bool "TIM6" bool "TIM6"
depends on STM32_HAVE_TIM6 && !STM32_TIM6 depends on STM32_HAVE_TIM6 && !STM32_TIM6
---help--- ---help---
The library will use TIM6. The library will use TIM6.
config UAVCAN_STM32_TIM7 config LIBUAVCAN_STM32_TIM7
bool "TIM7" bool "TIM7"
depends on STM32_HAVE_TIM7 && !STM32_TIM7 depends on STM32_HAVE_TIM7 && !STM32_TIM7
---help--- ---help---
@ -109,111 +109,111 @@ endchoice
choice choice
prompt "C++ Version" prompt "C++ Version"
default UAVCAN_CPP03 default LIBUAVCAN_CPP03
config UAVCAN_CPP03 config LIBUAVCAN_CPP03
bool "C++03" bool "C++03"
---help--- ---help---
The library will use C++03. The library will use C++03.
config UAVCAN_CPP11 config LIBUAVCAN_CPP11
bool "C++11" bool "C++11"
---help--- ---help---
The library will use C++11. The library will use C++11.
endchoice endchoice
config UAVCAN_DEBUG config LIBUAVCAN_DEBUG
bool "Debug" bool "Debug"
default n default n
---help--- ---help---
Enables debug. Enables debug.
config UAVCAN_EXCEPTIONS config LIBUAVCAN_EXCEPTIONS
bool "Exceptions" bool "Exceptions"
default n default n
---help--- ---help---
Enables exceptions. Enables exceptions.
config UAVCAN_TINY config LIBUAVCAN_TINY
bool "Tiny" bool "Tiny"
default n default n
---help--- ---help---
Removes some features to save memory. Removes some features to save memory.
config UAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY config LIBUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY
bool "No Global Data Type Registry" bool "No Global Data Type Registry"
default n default n
---help--- ---help---
Removes the global data type registry. Removes the global data type registry.
config UAVCAN_TOSTRING config LIBUAVCAN_TOSTRING
bool "Implement toString" bool "Implement toString"
default n default n
depends on UAVCAN_EXCEPTIONS depends on LIBUAVCAN_EXCEPTIONS
---help--- ---help---
The library will add a toString method to most of its classes. The library will add a toString method to most of its classes.
config UAVCAN_IMPLEMENT_PLACEMENT_NEW config LIBUAVCAN_IMPLEMENT_PLACEMENT_NEW
bool "Implement Placement new" bool "Implement Placement new"
default n default n
---help--- ---help---
The library will implement placement new. The library will implement placement new.
config UAVCAN_USE_EXTERNAL_SNPRINTF config LIBUAVCAN_USE_EXTERNAL_SNPRINTF
bool "Use External snprintf" bool "Use External snprintf"
default n default n
---help--- ---help---
The library will use an external snprintf. The library will use an external snprintf.
config UAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION config LIBUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION
bool "Use External float16 Conversion" bool "Use External float16 Conversion"
default n default n
---help--- ---help---
The library will use an external float16 conversion. The library will use an external float16 conversion.
config UAVCAN_NO_ASSERTIONS config LIBUAVCAN_NO_ASSERTIONS
bool "No Assertions" bool "No Assertions"
default n default n
---help--- ---help---
Disables assertions. Disables assertions.
config UAVCAN_MEM_POOL_BLOCK_SIZE config LIBUAVCAN_MEM_POOL_BLOCK_SIZE
int "Memory Pool Block Size" int "Memory Pool Block Size"
default 0 default 0
---help--- ---help---
Specifies the memory pool block size. If the value is 0, the Specifies the memory pool block size. If the value is 0, the
library will use a default value. library will use a default value.
config UAVCAN_FLOAT_COMPARISON_EPSILON_MULT config LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT
int "Float Comparion Epsilon Mult" int "Float Comparion Epsilon Mult"
default 0 default 0
---help--- ---help---
Specifies the float comparison epsilon mult. If the value is Specifies the float comparison epsilon mult. If the value is
0, the library will use a default value. 0, the library will use a default value.
config UAVCAN_MAX_CAN_ACCEPTANCE_FILTERS config LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS
int "Max CAN Acceptance Filters" int "Max CAN Acceptance Filters"
default 0 default 0
---help--- ---help---
Specifies the maximum number of CAN acceptance filters. If Specifies the maximum number of CAN acceptance filters. If
the value is 0, the library will use a default value. the value is 0, the library will use a default value.
config UAVCAN_MAX_NETWORK_SIZE_HINT config LIBUAVCAN_MAX_NETWORK_SIZE_HINT
int "Max Network Size Hint" int "Max Network Size Hint"
default 0 default 0
---help--- ---help---
Specifies the maximum network size. If the value is 0, the Specifies the maximum network size. If the value is 0, the
library will use a default value. library will use a default value.
config UAVCAN_RX_QUEUE_CAPACITY config LIBUAVCAN_RX_QUEUE_CAPACITY
int "Rx Queue Capacity" int "Rx Queue Capacity"
default 0 default 0
---help--- ---help---
Specifies the rx queue capacity. If the value is 0, the Specifies the rx queue capacity. If the value is 0, the
library will use a default value. library will use a default value.
config UAVCAN_BIT_RATE config LIBUAVCAN_BIT_RATE
int "Bit Rate" int "Bit Rate"
default 0 default 0
range 0 1000000 range 0 1000000
@ -221,7 +221,7 @@ config UAVCAN_BIT_RATE
Specifies the CAN bit rate. If the value is 0, the library Specifies the CAN bit rate. If the value is 0, the library
will automatically detect the bit rate. will automatically detect the bit rate.
config UAVCAN_INIT_RETRIES config LIBUAVCAN_INIT_RETRIES
int "Initialization Retries" int "Initialization Retries"
default 0 default 0
---help--- ---help---

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/canutils/uavcan/Make.defs # apps/canutils/libuavcan/Make.defs
# #
# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. # Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
# Author: Paul Alexander Patience <paul-a.patience@polymtl.ca> # Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -33,6 +33,6 @@
# #
############################################################################ ############################################################################
ifeq ($(CONFIG_CANUTILS_UAVCAN),y) ifeq ($(CONFIG_CANUTILS_LIBUAVCAN),y)
CONFIGURED_APPS += canutils/uavcan CONFIGURED_APPS += canutils/libuavcan
endif endif

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/canutils/uavcan/Makefile # apps/canutils/libuavcan/Makefile
# #
# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. # Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
# Author: Paul Alexander Patience <paul-a.patience@polymtl.ca> # Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -41,21 +41,21 @@ WGET = wget
UNPACK = unzip UNPACK = unzip
PACKEXT = .zip PACKEXT = .zip
LIBUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_LIBUAVCAN_URL))) LIBUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_URL)))
LIBUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_LIBUAVCAN_VERSION))) LIBUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_VERSION)))
LIBUAVCAN_UNPACKNAME = libuavcan-$(LIBUAVCAN_VERSION) LIBUAVCAN_UNPACKNAME = libuavcan-$(LIBUAVCAN_VERSION)
LIBUAVCAN_PACKNAME = $(LIBUAVCAN_UNPACKNAME)$(PACKEXT) LIBUAVCAN_PACKNAME = $(LIBUAVCAN_UNPACKNAME)$(PACKEXT)
LIBUAVCAN_DSDL_PATH = libuavcan$(DELIM)dsdl LIBUAVCAN_DSDL_PATH = libuavcan$(DELIM)dsdl
LIBUAVCAN_PYUAVCAN_PATH = libuavcan$(DELIM)libuavcan$(DELIM)dsdl_compiler$(DELIM)pyuavcan LIBUAVCAN_PYUAVCAN_PATH = libuavcan$(DELIM)libuavcan$(DELIM)dsdl_compiler$(DELIM)pyuavcan
LIBUAVCAN_PATCHNAME = nuttx-$(LIBUAVCAN_VERSION).patch LIBUAVCAN_PATCHNAME = nuttx-$(LIBUAVCAN_VERSION).patch
DSDL_URL = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_URL))) DSDL_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_DSDL_URL)))
DSDL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_DSDL_VERSION))) DSDL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_DSDL_VERSION)))
DSDL_UNPACKNAME = dsdl-$(DSDL_VERSION) DSDL_UNPACKNAME = dsdl-$(DSDL_VERSION)
DSDL_PACKNAME = $(DSDL_UNPACKNAME)$(PACKEXT) DSDL_PACKNAME = $(DSDL_UNPACKNAME)$(PACKEXT)
PYUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_PYUAVCAN_URL))) PYUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_PYUAVCAN_URL)))
PYUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_UAVCAN_PYUAVCAN_VERSION))) PYUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_PYUAVCAN_VERSION)))
PYUAVCAN_UNPACKNAME = pyuavcan-$(PYUAVCAN_VERSION) PYUAVCAN_UNPACKNAME = pyuavcan-$(PYUAVCAN_VERSION)
PYUAVCAN_PACKNAME = $(PYUAVCAN_UNPACKNAME)$(PACKEXT) PYUAVCAN_PACKNAME = $(PYUAVCAN_UNPACKNAME)$(PACKEXT)
@ -70,24 +70,24 @@ CXXFLAGS += -I$(TOPDIR)$(DELIM)arch$(DELIM)arm$(DELIM)src$(DELIM)stm32
CXXFLAGS += -D__KERNEL__ CXXFLAGS += -D__KERNEL__
CXXFLAGS += -DUAVCAN_STM32_NUTTX=1 CXXFLAGS += -DUAVCAN_STM32_NUTTX=1
CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=$(CONFIG_UAVCAN_STM32_NUM_IFACES) CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=$(CONFIG_LIBUAVCAN_STM32_NUM_IFACES)
ifeq ($(CONFIG_UAVCAN_STM32_TIM2),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM2),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=2 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=2
else else
ifeq ($(CONFIG_UAVCAN_STM32_TIM3),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM3),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=3 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=3
else else
ifeq ($(CONFIG_UAVCAN_STM32_TIM4),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM4),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=4 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=4
else else
ifeq ($(CONFIG_UAVCAN_STM32_TIM5),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM5),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=5 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=5
else else
ifeq ($(CONFIG_UAVCAN_STM32_TIM6),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM6),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=6 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=6
else else
ifeq ($(CONFIG_UAVCAN_STM32_TIM7),y) ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM7),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=7 CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=7
endif endif
endif endif
@ -96,68 +96,68 @@ endif
endif endif
endif endif
ifeq ($(CONFIG_UAVCAN_CPP03),y) ifeq ($(CONFIG_LIBUAVCAN_CPP03),y)
CXXFLAGS += -std=c++03 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 CXXFLAGS += -std=c++03 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03
else else
ifeq ($(CONFIG_UAVCAN_CPP11),y) ifeq ($(CONFIG_LIBUAVCAN_CPP11),y)
CXXFLAGS += -std=c++11 -DUAVCAN_CPP_VERSION=UAVCAN_CPP11 CXXFLAGS += -std=c++11 -DUAVCAN_CPP_VERSION=UAVCAN_CPP11
endif endif
endif endif
ifeq ($(CONFIG_UAVCAN_DEBUG),y) ifeq ($(CONFIG_LIBUAVCAN_DEBUG),y)
CXXFLAGS += -DUAVCAN_DEBUG=1 CXXFLAGS += -DUAVCAN_DEBUG=1
endif endif
ifeq ($(CONFIG_UAVCAN_EXCEPTIONS),y) ifeq ($(CONFIG_LIBUAVCAN_EXCEPTIONS),y)
CXXFLAGS += -DUAVCAN_EXCEPTIONS=1 CXXFLAGS += -DUAVCAN_EXCEPTIONS=1
else else
CXXFLAGS += -DUAVCAN_EXCEPTIONS=0 CXXFLAGS += -DUAVCAN_EXCEPTIONS=0
endif endif
ifeq ($(CONFIG_UAVCAN_TINY),y) ifeq ($(CONFIG_LIBUAVCAN_TINY),y)
CXXFLAGS += -DUAVCAN_TINY=1 CXXFLAGS += -DUAVCAN_TINY=1
endif endif
ifeq ($(CONFIG_UAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY),y) ifeq ($(CONFIG_LIBUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY),y)
CXXFLAGS += -DUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY=1 CXXFLAGS += -DUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY=1
endif endif
ifeq ($(CONFIG_UAVCAN_TOSTRING),y) ifeq ($(CONFIG_LIBUAVCAN_TOSTRING),y)
CXXFLAGS += -DUAVCAN_TOSTRING=1 CXXFLAGS += -DUAVCAN_TOSTRING=1
else else
CXXFLAGS += -DUAVCAN_TOSTRING=0 CXXFLAGS += -DUAVCAN_TOSTRING=0
endif endif
ifeq ($(CONFIG_UAVCAN_IMPLEMENT_PLACEMENT_NEW),y) ifeq ($(CONFIG_LIBUAVCAN_IMPLEMENT_PLACEMENT_NEW),y)
CXXFLAGS += -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 CXXFLAGS += -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1
endif endif
ifeq ($(CONFIG_UAVCAN_USE_EXTERNAL_SNPRINTF),y) ifeq ($(CONFIG_LIBUAVCAN_USE_EXTERNAL_SNPRINTF),y)
CXXFLAGS += -DUAVCAN_USE_EXTERNAL_SNPRINTF=1 CXXFLAGS += -DUAVCAN_USE_EXTERNAL_SNPRINTF=1
endif endif
ifeq ($(CONFIG_UAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION),y) ifeq ($(CONFIG_LIBUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION),y)
CXXFLAGS += -DUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION=1 CXXFLAGS += -DUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION=1
endif endif
ifeq ($(CONFIG_UAVCAN_NO_ASSERTIONS),y) ifeq ($(CONFIG_LIBUAVCAN_NO_ASSERTIONS),y)
CXXFLAGS += -DUAVCAN_NO_ASSERTIONS=1 CXXFLAGS += -DUAVCAN_NO_ASSERTIONS=1
endif endif
ifneq ($(CONFIG_UAVCAN_MEM_POOL_BLOCK_SIZE),0) ifneq ($(CONFIG_LIBUAVCAN_MEM_POOL_BLOCK_SIZE),0)
CXXFLAGS += -DUAVCAN_MEM_POOL_BLOCK_SIZE=$(CONFIG_UAVCAN_MEM_POOL_BLOCK_SIZE) CXXFLAGS += -DUAVCAN_MEM_POOL_BLOCK_SIZE=$(CONFIG_LIBUAVCAN_MEM_POOL_BLOCK_SIZE)
endif endif
ifneq ($(CONFIG_UAVCAN_FLOAT_COMPARISON_EPSILON_MULT),0) ifneq ($(CONFIG_LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT),0)
CXXFLAGS += -DUAVCAN_FLOAT_COMPARISON_EPSILON_MULT=$(CONFIG_UAVCAN_FLOAT_COMPARISON_EPSILON_MULT) CXXFLAGS += -DUAVCAN_FLOAT_COMPARISON_EPSILON_MULT=$(CONFIG_LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT)
endif endif
ifneq ($(CONFIG_UAVCAN_MAX_CAN_ACCEPTANCE_FILTERS),0) ifneq ($(CONFIG_LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS),0)
CXXFLAGS += -DUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS=$(CONFIG_UAVCAN_MAX_CAN_ACCEPTANCE_FILTERS) CXXFLAGS += -DUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS=$(CONFIG_LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS)
endif endif
ifneq ($(CONFIG_UAVCAN_MAX_NETWORK_SIZE_HINT),0) ifneq ($(CONFIG_LIBUAVCAN_MAX_NETWORK_SIZE_HINT),0)
CXXFLAGS += -DUAVCAN_MAX_NETWORK_SIZE_HINT=$(CONFIG_UAVCAN_MAX_NETWORK_SIZE_HINT) CXXFLAGS += -DUAVCAN_MAX_NETWORK_SIZE_HINT=$(CONFIG_LIBUAVCAN_MAX_NETWORK_SIZE_HINT)
endif endif
CXXEXT = .cpp CXXEXT = .cpp
@ -177,34 +177,38 @@ all: .built
.PHONY: clean depend distclean .PHONY: clean depend distclean
$(LIBUAVCAN_PACKNAME): $(LIBUAVCAN_PACKNAME):
@echo "Downloading: $(LIBUAVCAN_PACKNAME)" @echo "Downloading: $@"
$(Q) $(WGET) -O $(LIBUAVCAN_PACKNAME) $(LIBUAVCAN_URL)$(DELIM)$(LIBUAVCAN_VERSION)$(PACKEXT) $(Q) $(WGET) -O $@ $(LIBUAVCAN_URL)$(DELIM)$(LIBUAVCAN_VERSION)$(PACKEXT)
$(LIBUAVCAN_UNPACKNAME): $(LIBUAVCAN_PACKNAME) $(LIBUAVCAN_UNPACKNAME): $(LIBUAVCAN_PACKNAME)
@echo "Unpacking: $(LIBUAVCAN_PACKNAME) -> $(LIBUAVCAN_UNPACKNAME)" @echo "Unpacking: $< -> $@"
$(Q) $(UNPACK) $(LIBUAVCAN_PACKNAME) $(call DELDIR, $@)
$(Q) touch $(LIBUAVCAN_UNPACKNAME) $(Q) $(UNPACK) $<
$(Q) touch $@
$(DSDL_PACKNAME): $(DSDL_PACKNAME):
@echo "Downloading: $(DSDL_PACKNAME)" @echo "Downloading: $@"
$(Q) $(WGET) -O $(DSDL_PACKNAME) $(DSDL_URL)$(DELIM)$(DSDL_VERSION)$(PACKEXT) $(Q) $(WGET) -O $@ $(DSDL_URL)$(DELIM)$(DSDL_VERSION)$(PACKEXT)
$(DSDL_UNPACKNAME): $(DSDL_PACKNAME) $(DSDL_UNPACKNAME): $(DSDL_PACKNAME)
@echo "Unpacking: $(DSDL_PACKNAME) -> $(DSDL_UNPACKNAME)" @echo "Unpacking: $< -> $@"
$(Q) $(UNPACK) $(DSDL_PACKNAME) $(call DELDIR, $@)
$(Q) touch $(DSDL_UNPACKNAME) $(Q) $(UNPACK) $<
$(Q) touch $@
$(PYUAVCAN_PACKNAME): $(PYUAVCAN_PACKNAME):
@echo "Downloading: $(PYUAVCAN_PACKNAME)" @echo "Downloading: $@"
$(Q) $(WGET) -O $(PYUAVCAN_PACKNAME) $(PYUAVCAN_URL)$(DELIM)$(PYUAVCAN_VERSION)$(PACKEXT) $(Q) $(WGET) -O $@ $(PYUAVCAN_URL)$(DELIM)$(PYUAVCAN_VERSION)$(PACKEXT)
$(PYUAVCAN_UNPACKNAME): $(PYUAVCAN_PACKNAME) $(PYUAVCAN_UNPACKNAME): $(PYUAVCAN_PACKNAME)
@echo "Unpacking: $(PYUAVCAN_PACKNAME) -> $(PYUAVCAN_UNPACKNAME)" @echo "Unpacking: $< -> $@"
$(Q) $(UNPACK) $(PYUAVCAN_PACKNAME) $(call DELDIR, $@)
$(Q) touch $(PYUAVCAN_UNPACKNAME) $(Q) $(UNPACK) $<
$(Q) touch $@
libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME) libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME)
$(Q) cp -R $(LIBUAVCAN_UNPACKNAME) libuavcan $(call DELDIR, $@)
$(Q) cp -R $(LIBUAVCAN_UNPACKNAME) $@
$(Q) if [ -r $(LIBUAVCAN_PATCHNAME) ]; then \ $(Q) if [ -r $(LIBUAVCAN_PATCHNAME) ]; then \
cat $(LIBUAVCAN_PATCHNAME) | patch -p0 || { echo "ERROR: Patch failed"; exit 1; }; \ cat $(LIBUAVCAN_PATCHNAME) | patch -p0 || { echo "ERROR: Patch failed"; exit 1; }; \
fi fi
@ -212,6 +216,7 @@ libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME)
$(Q) cp -R $(DSDL_UNPACKNAME) $(LIBUAVCAN_DSDL_PATH) $(Q) cp -R $(DSDL_UNPACKNAME) $(LIBUAVCAN_DSDL_PATH)
$(call DELDIR, $(LIBUAVCAN_PYUAVCAN_PATH)) $(call DELDIR, $(LIBUAVCAN_PYUAVCAN_PATH))
$(Q) cp -R $(PYUAVCAN_UNPACKNAME) $(LIBUAVCAN_PYUAVCAN_PATH) $(Q) cp -R $(PYUAVCAN_UNPACKNAME) $(LIBUAVCAN_PYUAVCAN_PATH)
$(Q) touch $@
dsdlc_generated: libuavcan dsdlc_generated: libuavcan
$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR))) $(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR)))
@ -226,7 +231,7 @@ $(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
.built: $(CXXOBJS) .built: $(CXXOBJS)
$(call ARCHIVE, $(BIN), $(CXXOBJS)) $(call ARCHIVE, $(BIN), $(CXXOBJS))
$(Q) touch .built $(Q) touch $@
install: install:
@ -248,7 +253,7 @@ clean:
distclean: clean distclean: clean
$(call DELFILE, Make.dep) $(call DELFILE, Make.dep)
$(call DELFILE, .depend) $(call DELFILE, .depend)
$(call DEFLFILE, .libuavcan_patched) $(call DELDIR, libuavcan)
$(call DELDIR, $(LIBUAVCAN_UNPACKNAME)) $(call DELDIR, $(LIBUAVCAN_UNPACKNAME))
$(call DELFILE, $(LIBUAVCAN_PACKNAME)) $(call DELFILE, $(LIBUAVCAN_PACKNAME))
$(call DELDIR, $(DSDL_UNPACKNAME)) $(call DELDIR, $(DSDL_UNPACKNAME))

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* canutils/uavcan/uavcan_platform.cpp * canutils/libuavcan/platform_stm32.cpp
* *
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. * Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
* Author: Paul Alexander Patience <paul-a.patience@polymtl.ca> * Author: Paul Alexander Patience <paul-a.patience@polymtl.ca>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -47,9 +47,9 @@
* Configuration * Configuration
****************************************************************************/ ****************************************************************************/
#if CONFIG_UAVCAN_RX_QUEUE_CAPACITY == 0 #if CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY == 0
# undef CONFIG_UAVCAN_RX_QUEUE_CAPACITY # undef CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY
# define CONFIG_UAVCAN_RX_QUEUE_CAPACITY # define CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY
#endif #endif
/**************************************************************************** /****************************************************************************
@ -58,7 +58,8 @@
static void delay(void) static void delay(void)
{ {
std::usleep(uavcan_stm32::CanInitHelper<CONFIG_UAVCAN_RX_QUEUE_CAPACITY>:: std::usleep(uavcan_stm32::
CanInitHelper<CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY>::
getRecommendedListeningDelay().toUSec()); getRecommendedListeningDelay().toUSec());
} }
@ -68,22 +69,22 @@ static void delay(void)
uavcan::ICanDriver &getCanDriver(void) uavcan::ICanDriver &getCanDriver(void)
{ {
static uavcan_stm32::CanInitHelper<CONFIG_UAVCAN_RX_QUEUE_CAPACITY> can; static uavcan_stm32::CanInitHelper<CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY> can;
static bool initialized = false; static bool initialized = false;
if (!initialized) if (!initialized)
{ {
uavcan::uint32_t bitrate = CONFIG_UAVCAN_BIT_RATE; uavcan::uint32_t bitrate = CONFIG_LIBUAVCAN_BIT_RATE;
#if CONFIG_UAVCAN_INIT_RETRIES > 0 #if CONFIG_LIBUAVCAN_INIT_RETRIES > 0
int retries = 0; int retries = 0;
#endif #endif
while (can.init(delay, bitrate) < 0) while (can.init(delay, bitrate) < 0)
{ {
#if CONFIG_UAVCAN_INIT_RETRIES > 0 #if CONFIG_LIBUAVCAN_INIT_RETRIES > 0
retries++; retries++;
if (retries >= CONFIG_UAVCAN_INIT_RETRIES) if (retries >= CONFIG_LIBUAVCAN_INIT_RETRIES)
{ {
PANIC(); PANIC();
} }

View File

@ -68,7 +68,6 @@ source "$APPSDIR/examples/relays/Kconfig"
source "$APPSDIR/examples/rgbled/Kconfig" source "$APPSDIR/examples/rgbled/Kconfig"
source "$APPSDIR/examples/rgmp/Kconfig" source "$APPSDIR/examples/rgmp/Kconfig"
source "$APPSDIR/examples/romfs/Kconfig" source "$APPSDIR/examples/romfs/Kconfig"
source "$APPSDIR/examples/sched_note/Kconfig"
source "$APPSDIR/examples/sendmail/Kconfig" source "$APPSDIR/examples/sendmail/Kconfig"
source "$APPSDIR/examples/serialblaster/Kconfig" source "$APPSDIR/examples/serialblaster/Kconfig"
source "$APPSDIR/examples/serialrx/Kconfig" source "$APPSDIR/examples/serialrx/Kconfig"

View File

@ -1751,11 +1751,6 @@ examples/romfs
* CONFIG_EXAMPLES_ROMFS_MOUNTPOINT * CONFIG_EXAMPLES_ROMFS_MOUNTPOINT
The location to mount the ROM disk. Deafault: "/usr/local/share" The location to mount the ROM disk. Deafault: "/usr/local/share"
examples/sched_note
^^^^^^^^^^^^^^^^^^^
This is a simple test of the Scheduler instrumentation logic.
examples/sendmail examples/sendmail
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/errno/Makefile # examples/elf/tests/errno/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/hello/Makefile # examples/elf/tests/hello/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/helloxx/Makefile # examples/elf/tests/helloxx/Makefile
# #
# Copyright (C) 2012, 2014-2015 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -98,6 +101,7 @@ LDLIBSTDC_STUBS_DIR = $(TOPDIR)/libxx
LDLIBSTDC_STUBS_LIB = $(LDLIBSTDC_STUBS_DIR)/liblibxx.a LDLIBSTDC_STUBS_LIB = $(LDLIBSTDC_STUBS_DIR)/liblibxx.a
all: $(BIN1) $(BIN2) $(BIN3) $(BIN4) $(BIN5) all: $(BIN1) $(BIN2) $(BIN3) $(BIN4) $(BIN5)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.cpp $(OBJS): %$(OBJEXT): %.cpp
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/longjmp/Makefile # examples/elf/tests/longjmp/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/mutex/Makefile # examples/elf/tests/mutex/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/pthread/Makefile # examples/elf/tests/pthread/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/signal/Makefile # examples/elf/tests/signal/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/struct/Makefile # examples/elf/tests/struct/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
CELFFLAGS += -I. CELFFLAGS += -I.
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
@ -70,6 +73,7 @@ SRCS = struct_main.c struct_dummy.c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/task/Makefile # examples/elf/tests/task/Makefile
# #
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/examples/module/Makefile # apps/examples/module/Makefile
# #
# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,10 @@
-include $(TOPDIR)/.config -include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
include $(APPDIR)/Make.defs include $(APPDIR)/Make.defs
# Module example built-in application info # Module example built-in application info

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/module/drivers/chardev/Makefile # examples/module/drivers/chardev/Makefile
# #
# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}" NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else else
@ -71,6 +74,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT)) OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c $(OBJS): %$(OBJEXT): %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/elf/tests/hello/Makefile # examples/elf/tests/hello/Makefile
# #
# Copyright (C) 2012 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %.o: %.c $(OBJS): %.o: %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/posix_spawn/filesystem/redirect/Makefile # examples/posix_spawn/filesystem/redirect/Makefile
# #
# Copyright (C) 2013 Gregory Nutt. All rights reserved. # Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(OBJS): %.o: %.c $(OBJS): %.o: %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -309,7 +309,7 @@ int smp_main(int argc, char *argv[])
for (i = 0; i < CONFIG_EXAMPLES_SMP_NBARRIER_THREADS; i++) for (i = 0; i < CONFIG_EXAMPLES_SMP_NBARRIER_THREADS; i++)
{ {
if (threadid[i] != 0); if (threadid[i] != 0)
{ {
ret = pthread_join(threadid[i], &result); ret = pthread_join(threadid[i], &result);
show_cpu_conditional(" Main", 0); show_cpu_conditional(" Main", 0);

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/thttpd/content/hello/Makefile # examples/thttpd/content/hello/Makefile
# #
# Copyright (C) 2009 Gregory Nutt. All rights reserved. # Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -44,6 +44,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o) R2OBJ = $(R2SRC:.S=.o)
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c $(R1OBJS): %.o: %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/thttpd/content/netstat/Makefile # examples/thttpd/content/netstat/Makefile
# #
# Copyright (C) 2009 Gregory Nutt. All rights reserved. # Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -44,6 +44,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o) R2OBJ = $(R2SRC:.S=.o)
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c $(R1OBJS): %.o: %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# examples/thttpd/content/tasks/Makefile # examples/thttpd/content/tasks/Makefile
# #
# Copyright (C) 2009 Gregory Nutt. All rights reserved. # Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
BIN = tasks BIN = tasks
R1SRCS = $(BIN).c R1SRCS = $(BIN).c
@ -44,6 +47,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o) R2OBJ = $(R2SRC:.S=.o)
all: $(BIN) all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c $(R1OBJS): %.o: %.c
@echo "CC: $<" @echo "CC: $<"

View File

@ -6,7 +6,7 @@
config EXAMPLES_UAVCAN config EXAMPLES_UAVCAN
bool "UAVCAN example" bool "UAVCAN example"
default n default n
depends on CANUTILS_UAVCAN depends on CANUTILS_LIBUAVCAN
---help--- ---help---
Enable the UAVCAN example Enable the UAVCAN example

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/examples/usbserial/Makefile # apps/examples/usbserial/Makefile
# #
# Copyright (C) 2008, 2010-2012 Gregory Nutt. All rights reserved. # Copyright (C) 2008, 2010-2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/examples/usbserial/Makefile.host # apps/examples/usbserial/Makefile.host
# #
# Copyright (C) 2008, 2011, 2015 Gregory Nutt. All rights reserved. # Copyright (C) 2008, 2011, 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -58,6 +58,7 @@ DEFINES += -DCONFIG_CDCACM=1
endif endif
all: $(BIN) all: $(BIN)
.PHONY: clean
$(BIN): $(SRC) $(BIN): $(SRC)
@$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@ @$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@

View File

@ -9,6 +9,28 @@ config EXAMPLES_WATCHDOG
---help--- ---help---
Enable the watchdog timer example Enable the watchdog timer example
In order to use this example, board specific logic must register the
watchdog timer driver. That would be in the board bring-up logic
in the configs/<board>/src directory for the board.
The way that this is done depends on the underlying MCU architecture.
For STM32, this would be done like:
#include "stm32_wdg.h"
#if defined(CONFIG_STM32_WWDG)
stm32_wwdginitialize(CONFIG_STM32_WDG_DEVPATH);
#elif defined(CONFIG_STM32_IWDG)
stm32_iwdginitialize(CONFIG_STM32_WDG_DEVPATH, CONFIG_STM32_LSIFREQ);
#endif
For some Atmel SAM configurations, the board-specific initialization
sequence would be like:
#include "sam_wdt.h"
sam_wdt_initialize();
if EXAMPLES_WATCHDOG if EXAMPLES_WATCHDOG
config EXAMPLES_WATCHDOG_DEVPATH config EXAMPLES_WATCHDOG_DEVPATH

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* examples/watchdog/watchdog_main.c * examples/watchdog/watchdog_main.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -53,10 +53,6 @@
#include "watchdog.h" #include "watchdog.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Private Types * Private Types
****************************************************************************/ ****************************************************************************/
@ -68,18 +64,6 @@ struct wdog_example_s
uint32_t timeout; uint32_t timeout;
}; };
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
@ -238,17 +222,6 @@ int wdog_main(int argc, char *argv[])
parse_args(&wdog, argc, argv); parse_args(&wdog, argc, argv);
/* Initialization of the WATCHDOG hardware is performed by logic external to
* this test.
*/
ret = up_wdginitialize();
if (ret != OK)
{
printf("wdog_main: up_wdginitialize failed: %d\n", ret);
goto errout;
}
/* Open the watchdog device for reading */ /* Open the watchdog device for reading */
fd = open(CONFIG_EXAMPLES_WATCHDOG_DEVPATH, O_RDONLY); fd = open(CONFIG_EXAMPLES_WATCHDOG_DEVPATH, O_RDONLY);

1
include/canutils/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/canard.h

122
include/netutils/esp8266.h Normal file
View File

@ -0,0 +1,122 @@
/****************************************************************************
* apps/include/netutils/esp8266.h
*
* Copyright (C) 2015 Pierre-Noel Bouteville. All rights reserved.
* Author: Pierre-Noel Bouteville <pnb990@gmail.com>
*
* 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.
*
****************************************************************************/
#ifndef __APPS_INCLUDE_NETUTILS_ESP8266_H
#define __APPS_INCLUDE_NETUTILS_ESP8266_H
/****************************************************************************
* Included Files
****************************************************************************/
#include "nuttx/config.h"
#include <netinet/in.h>
#ifdef CONFIG_NETUTILS_ESP8266
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define lespBSSID_SIZE 6
#define lespIP(x1,x2,x3,x4) ((x1) << 24 | (x2) << 16 | (x3) << 8 | (x4) << 0)
/****************************************************************************
* Public Types
****************************************************************************/
typedef enum
{
lesp_eMODE_AP = 0,
lesp_eMODE_STATION = 1,
lesp_eMODE_BOTH = 2
} lesp_mode_t;
typedef enum
{
lesp_eSECURITY_NONE=0,
lesp_eSECURITY_WEP,
lesp_eSECURITY_WPA_PSK,
lesp_eSECURITY_WPA2_PSK,
lesp_eSECURITY_WPA_WPA2_PSK,
lesp_eSECURITY_NBR
} lesp_security_t;
typedef struct
{
lesp_security_t security;
const char *ssid;
uint8_t bssid[lespBSSID_SIZE];
int rssi;
} lesp_ap_t;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
int lesp_initialize(void);
int lesp_soft_reset(void);
const char *lesp_security_to_str(lesp_security_t security);
int lesp_ap_connect(const char* ssid_name, const char* ap_key, int timeout_s);
int lesp_ap_is_connected(void);
int lesp_set_dhcp(lesp_mode_t mode,bool enable);
int lesp_set_net(lesp_mode_t mode,
in_addr_t ip,
in_addr_t mask,
in_addr_t gateway
);
typedef void (*lesp_cb_t)(lesp_ap_t* wlan);
int lesp_list_access_points(lesp_cb_t cb);
int lesp_socket(int domain, int type, int protocol);
int lesp_closesocket(int sockfd);
int lesp_bind(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen);
int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen);
int lesp_listen(int sockfd, int backlog);
int lesp_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
ssize_t lesp_send(int sockfd, FAR const uint8_t *buf, size_t len, int flags);
ssize_t lesp_recv(int sockfd, FAR uint8_t *buf, size_t len, int flags);
int lesp_setsockopt(int sockfd, int level, int option,
FAR const void *value, socklen_t value_len);
#endif /* CONFIG_NETUTILS_ESP8266 */
#endif /* __APPS_INCLUDE_NETUTILS_ESP8266_H */

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/ interpreters/micropython/Makefile # apps/ interpreters/micropython/Makefile
# #
# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved.
# Authors: Gregory Nutt <gnutt@nuttx.org> # Authors: Gregory Nutt <gnutt@nuttx.org>
# Dave Marples <dave@marples.net> # Dave Marples <dave@marples.net>
# #
@ -55,7 +55,7 @@ MICROPYTHON_UNPACKNAME = micropython-$(MICROPYTHON_VERSION)
UNPACK ?= tar -zxf UNPACK ?= tar -zxf
MICROPYTHON_UNPACKDIR = $(WD)/$(MICROPYTHON_UNPACKNAME) MICROPYTHON_UNPACKDIR = $(WD)/$(MICROPYTHON_UNPACKNAME)
MICROPTHYON_SRCDIR = $(MICROPYTHON_UNPACKDIR)/py MICROPYTHON_SRCDIR = $(MICROPYTHON_UNPACKDIR)/py
# Get the Micro Python build environment. mkenv.mk has these dependencies # Get the Micro Python build environment. mkenv.mk has these dependencies
# #
@ -63,7 +63,7 @@ MICROPTHYON_SRCDIR = $(MICROPYTHON_UNPACKDIR)/py
# CROSS_COMPILE - Tool prefix (same as CROSSDEV in NuttX) # CROSS_COMPILE - Tool prefix (same as CROSSDEV in NuttX)
CROSS_COMPILE ?= $(CROSSDEV) CROSS_COMPILE ?= $(CROSSDEV)
-include $(MICROPTHYON_SRCDIR)/mkenv.mk -include $(MICROPYTHON_SRCDIR)/mkenv.mk
# qstr definitions (must come before including py.mk) # qstr definitions (must come before including py.mk)
@ -71,7 +71,7 @@ QSTR_DEFS = qstrdefsport.h
# Include py core make definitions # Include py core make definitions
-include $(MICROPTHYON_SRCDIR)/py.mk -include $(MICROPYTHON_SRCDIR)/py.mk
# c99 is needed for Micro Python # c99 is needed for Micro Python
@ -127,6 +127,7 @@ ROOTDEPPATH = --dep-path .
# Common build # Common build
all: .built all: .built
.PHONY: install context clean distclean
$(MICROPYTHON_TARBALL): $(MICROPYTHON_TARBALL):
@echo "Downloading: $(MICROPYTHON_TARBALL)" @echo "Downloading: $(MICROPYTHON_TARBALL)"
@ -139,7 +140,7 @@ $(MICROPYTHON_UNPACKNAME): $(MICROPYTHON_TARBALL)
.built: $(MICROPYTHON_UNPACKNAME) $(OBJ) .built: $(MICROPYTHON_UNPACKNAME) $(OBJ)
$(call ARCHIVE, $(BIN), $(OBJ)) $(call ARCHIVE, $(BIN), $(OBJ))
@touch .built @touch $@
ifeq ($(CONFIG_BUILD_KERNEL),y) ifeq ($(CONFIG_BUILD_KERNEL),y)
$(BIN_DIR)$(DELIM)$(PROGNAME): $(MICROPYTHON_UNPACKNAME) $(OBJ) $(MAINOBJ) $(BIN_DIR)$(DELIM)$(PROGNAME): $(MICROPYTHON_UNPACKNAME) $(OBJ) $(MAINOBJ)
@ -179,5 +180,5 @@ distclean: clean
$(call DELFILE, .downloaded) $(call DELFILE, .downloaded)
$(call DELFILE, $(MICROPYTHON_TARBALL)) $(call DELFILE, $(MICROPYTHON_TARBALL))
-include $(MICROPTHYON_SRCDIR)/mkrules.mk -include $(MICROPYTHON_SRCDIR)/mkrules.mk
-include Make.dep -include Make.dep

View File

@ -9,6 +9,7 @@ source "$APPSDIR/netutils/chat/Kconfig"
source "$APPSDIR/netutils/codecs/Kconfig" source "$APPSDIR/netutils/codecs/Kconfig"
source "$APPSDIR/netutils/dhcpc/Kconfig" source "$APPSDIR/netutils/dhcpc/Kconfig"
source "$APPSDIR/netutils/dhcpd/Kconfig" source "$APPSDIR/netutils/dhcpd/Kconfig"
source "$APPSDIR/netutils/esp8266/Kconfig"
source "$APPSDIR/netutils/ftpc/Kconfig" source "$APPSDIR/netutils/ftpc/Kconfig"
source "$APPSDIR/netutils/ftpd/Kconfig" source "$APPSDIR/netutils/ftpd/Kconfig"
source "$APPSDIR/netutils/json/Kconfig" source "$APPSDIR/netutils/json/Kconfig"

View File

@ -2,7 +2,7 @@
# apps/netutils/Make.defs # apps/netutils/Make.defs
# Adds selected applications to apps/ build # Adds selected applications to apps/ build
# #
# Copyright (C) 2012 Gregory Nutt. All rights reserved. # Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in include and binary forms, with or without # Redistribution and use in include and binary forms, with or without
@ -50,6 +50,10 @@ ifeq ($(CONFIG_NETUTILS_DHCPD),y)
CONFIGURED_APPS += netutils/dhcpd CONFIGURED_APPS += netutils/dhcpd
endif endif
ifeq ($(CONFIG_NETUTILS_ESP8266),y)
CONFIGURED_APPS += netutils/esp8266
endif
ifeq ($(CONFIG_NETUTILS_FTPC),y) ifeq ($(CONFIG_NETUTILS_FTPC),y)
CONFIGURED_APPS += netutils/ftpc CONFIGURED_APPS += netutils/ftpc
endif endif

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/netutils/Makefile # apps/netutils/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> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -37,7 +37,7 @@
# Sub-directories # Sub-directories
SUBDIRS = chat json codecs SUBDIRS = chat json codecs esp8266
ifeq ($(CONFIG_NET),y) ifeq ($(CONFIG_NET),y)
SUBDIRS += netlib dhcpc dhcpd discover ftpc ftpd smtp telnetd SUBDIRS += netlib dhcpc dhcpd discover ftpc ftpd smtp telnetd
SUBDIRS += webclient webserver tftpc thttpd xmlrpc pppd SUBDIRS += webclient webserver tftpc thttpd xmlrpc pppd

View File

@ -45,6 +45,8 @@ highly influenced by uIP) include:
device class so that groups of devices can be discovered. device class so that groups of devices can be discovered.
It is also possible to address all classes with a kind of It is also possible to address all classes with a kind of
broadcast discover. (Contributed by Max Holtzberg). broadcast discover. (Contributed by Max Holtzberg).
esp8266 - An ESP8266 networking layer contributed by Pierre-noel
Bouteville
json - cJSON is an ultra-lightweight, portable, single-file, json - cJSON is an ultra-lightweight, portable, single-file,
simple-as-can-be ANSI-C compliant JSON parser, under MIT simple-as-can-be ANSI-C compliant JSON parser, under MIT
license. Embeddable Lightweight XML-RPC Server discussed at license. Embeddable Lightweight XML-RPC Server discussed at

6
netutils/esp8266/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/.built
/.depend
/Make.dep
/*.src
/*.obj
/*.lst

34
netutils/esp8266/Kconfig Normal file
View File

@ -0,0 +1,34 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config NETUTILS_ESP8266
bool "ESP8266"
default n
---help---
Enable support for ESP8266 application interface.
if NETUTILS_ESP8266
config NETUTILS_ESP8266_DEV_PATH
string "Serial device path"
default "/dev/ttyS1"
config NETUTILS_ESP8266_BAUDRATE
int "Serial BAUD rate"
default 115200
config NETUTILS_ESP8266_MAXTXLEN
int "Max. TX length"
default 256
config NETUTILS_ESP8266_MAXRXLEN
int "Max. RX length"
default 256
config NETUTILS_ESP8266_THREADPRIO
int "Worker thread priority"
default 100
endif

98
netutils/esp8266/Makefile Normal file
View File

@ -0,0 +1,98 @@
############################################################################
# apps/netutils/esp8266/Makefile
#
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# ESP8266 Library
ASRCS =
CSRCS = esp8266.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
ifeq ($(WINTOOL),y)
BIN = ..\\..\\libapps$(LIBEXT)
else
BIN = ../../libapps$(LIBEXT)
endif
endif
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: context depend clean distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
.built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS))
$(Q) touch .built
install:
context:
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
$(call DELFILE, .built)
$(call CLEAN)
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-include Make.dep

1451
netutils/esp8266/esp8266.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
############################################################################ ############################################################################
# apps/platform/Makefile # apps/platform/Makefile
# #
# Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. # Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -36,7 +36,9 @@
-include $(TOPDIR)/.config -include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs -include $(TOPDIR)/Make.defs
CONFIG_ARCH_BOARD ?= dummy
DELIM ?= $(strip /) DELIM ?= $(strip /)
include $(APPDIR)$(DELIM)Make.defs include $(APPDIR)$(DELIM)Make.defs
# Platform-specific Appliction Support # Platform-specific Appliction Support
@ -116,6 +118,8 @@ endif
# Build context setup # Build context setup
$(TOPDIR)$(DELIM).config:
$(PLATFORMDIR): $(TOPDIR)$(DELIM).config $(PLATFORMDIR): $(TOPDIR)$(DELIM).config
@echo "LN: platform$(DELIM)board to $(LINKDIR)" @echo "LN: platform$(DELIM)board to $(LINKDIR)"
$(Q) $(DIRUNLINK) $(PLATFORMDIR) $(Q) $(DIRUNLINK) $(PLATFORMDIR)
@ -135,7 +139,7 @@ depend: .depend
# Clean targets # Clean targets
clean: $(PLATFORMDIR) clean:
$(call DELFILE, .built) $(call DELFILE, .built)
$(Q) $(MAKE) -C bin TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" clean $(Q) $(MAKE) -C bin TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" clean

View File

@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if CONFIG_ARCH_BOARD_NUCLEO_144
endif

View File

@ -0,0 +1,41 @@
############################################################################
# apps/platform/nucleo-144/Make.defs
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
# Author: Mark Olsson <post@markolsson.se>
#
# 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.
#
############################################################################
# Add platform specific sources to ASRCS and CSRCS
ifeq ($(CONFIG_HAVE_CXX),y)
CSRCS += stm32_cxxinitialize.c
endif

View File

@ -0,0 +1,154 @@
/****************************************************************************
* apps/platform/nucleo-144/stm32_cxxinitialize.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Author: Mark Olsson <post@markolsson.se>
*
* 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 <debug.h>
#include <nuttx/arch.h>
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Debug ********************************************************************/
/* Non-standard debug that may be enabled just for testing the static
* constructors
*/
#ifndef CONFIG_DEBUG
# 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
#else
# define cxxdbg(x...)
# define cxxlldbg(x...)
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
#endif
/****************************************************************************
* Private Types
****************************************************************************/
/* This type defines one entry in initialization array */
typedef void (*initializer_t)(void);
/****************************************************************************
* External References
****************************************************************************/
/* _sinit and _einit are symbols exported by the linker script that mark the
* beginning and the end of the C++ initialization section.
*/
extern initializer_t _sinit;
extern initializer_t _einit;
/* _stext and _etext are symbols exported by the linker script that mark the
* beginning and the end of text.
*/
extern uint32_t _stext;
extern uint32_t _etext;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_cxxinitialize
*
* Description:
* If C++ and C++ static constructors are supported, then this function
* must be provided by board-specific logic in order to perform
* initialization of the static C++ class instances.
*
* This function should then be called in the application-specific
* user_start logic in order to perform the C++ initialization. NOTE
* that no component of the core NuttX RTOS logic is involved; this
* function definition only provides the 'contract' between application
* specific C++ code and platform-specific toolchain support.
*
****************************************************************************/
void up_cxxinitialize(void)
{
initializer_t *initp;
cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
&_sinit, &_einit, &_stext, &_etext);
/* Visit each entry in the initialization table */
for (initp = &_sinit; initp != &_einit; initp++)
{
initializer_t initializer = *initp;
cxxdbg("initp: %p initializer: %p\n", initp, initializer);
/* Make sure that the address is non-NULL and lies in the text region
* defined by the linker script. Some toolchains may put NULL values
* or counts in the initialization table.
*/
if ((void *)initializer > (void *)&_stext &&
(void *)initializer < (void *)&_etext)
{
cxxdbg("Calling %p\n", initializer);
initializer();
}
}
}
#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */

View File

@ -22,6 +22,7 @@ source "$APPSDIR/system/mdio/Kconfig"
source "$APPSDIR/system/sudoku/Kconfig" source "$APPSDIR/system/sudoku/Kconfig"
source "$APPSDIR/system/lm75/Kconfig" source "$APPSDIR/system/lm75/Kconfig"
source "$APPSDIR/system/vi/Kconfig" source "$APPSDIR/system/vi/Kconfig"
source "$APPSDIR/system/sched_note/Kconfig"
source "$APPSDIR/system/stackmonitor/Kconfig" source "$APPSDIR/system/stackmonitor/Kconfig"
source "$APPSDIR/system/symtab/Kconfig" source "$APPSDIR/system/symtab/Kconfig"
source "$APPSDIR/system/cdcacm/Kconfig" source "$APPSDIR/system/cdcacm/Kconfig"

View File

@ -102,6 +102,10 @@ ifeq ($(CONFIG_SYSTEM_READLINE),y)
CONFIGURED_APPS += system/readline CONFIGURED_APPS += system/readline
endif endif
ifeq ($(CONFIG_SYSTEM_NOTE),y)
CONFIGURED_APPS += system/sched_note
endif
ifeq ($(CONFIG_SYSTEM_SUDOKU),y) ifeq ($(CONFIG_SYSTEM_SUDOKU),y)
CONFIGURED_APPS += system/sudoku CONFIGURED_APPS += system/sudoku
endif endif

View File

@ -87,11 +87,11 @@ else
INSTALL_DIR = $(BIN_DIR) INSTALL_DIR = $(BIN_DIR)
endif endif
CONFIG_EXAMPLES_HEX2BIN_PROGNAME ?= hex2bin$(EXEEXT) CONFIG_SYSTEM_HEX2BIN_PROGNAME ?= hex2bin$(EXEEXT)
HEX2BIN_PROGNAME = $(CONFIG_EXAMPLES_HEX2BIN_PROGNAME) HEX2BIN_PROGNAME = $(CONFIG_SYSTEM_HEX2BIN_PROGNAME)
CONFIG_EXAMPLES_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT) CONFIG_SYSTEM_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT)
HEX2MEM_PROGNAME = $(CONFIG_EXAMPLES_HEX2MEM_PROGNAME) HEX2MEM_PROGNAME = $(CONFIG_SYSTEM_HEX2MEM_PROGNAME)
ROOTDEPPATH = --dep-path . ROOTDEPPATH = --dep-path .
VPATH = VPATH =

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/examples/mdio/Makefile # apps/system/mdio/Makefile
# #
# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved. # Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* examples/mdio/mdio_main.c * system/mdio/mdio_main.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* examples/prun/prun.h * apps/system/prun/prun.h
* *
* Copyright (C) 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __EXAMPLES_PASHELLO_H #ifndef __APPS_SYSTEM_PRUN_H
#define __EXAMPLES_PASHELLO_H #define __APPS_SYSTEM_PRUN_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@ -52,4 +52,4 @@
extern void hello_register(void); extern void hello_register(void);
#endif /* __EXAMPLES_PASHELLO_H */ #endif /* __APPS_SYSTEM_PRUN_H */

View File

@ -3,16 +3,16 @@
# see the file kconfig-language.txt in the NuttX tools repository. # see the file kconfig-language.txt in the NuttX tools repository.
# #
config EXAMPLES_NOTE config SYSTEM_NOTE
bool "Scheduler instrumentation example" bool "Scheduler monitor"
default n default n
depends on DRIVER_NOTE depends on DRIVER_NOTE
---help--- ---help---
Enable the schedler instrumentation example Enable the schedler instrumentation monitor
if EXAMPLES_NOTE if SYSTEM_NOTE
config EXAMPLES_NOTE_PROGNAME config SYSTEM_NOTE_PROGNAME
string "Program name" string "Program name"
default "note" default "note"
depends on BUILD_KERNEL depends on BUILD_KERNEL
@ -20,20 +20,20 @@ config EXAMPLES_NOTE_PROGNAME
This is the name of the program that will be use when the NSH ELF This is the name of the program that will be use when the NSH ELF
program is installed. program is installed.
config EXAMPLES_NOTE_PRIORITY config SYSTEM_NOTE_PRIORITY
int "Note daemon task priority" int "Note daemon task priority"
default 100 default 100
config EXAMPLES_NOTE_STACKSIZE config SYSTEM_NOTE_STACKSIZE
int "Note daemon stack size" int "Note daemon stack size"
default 2048 default 2048
config EXAMPLES_NOTE_BUFFERSIZE config SYSTEM_NOTE_BUFFERSIZE
int "Note daemon I/O buffer size" int "Note daemon I/O buffer size"
default 1024 default 1024
config EXAMPLES_NOTE_DELAY config SYSTEM_NOTE_DELAY
int "Note daemon sample delay (msec)" int "Note daemon sample delay (msec)"
default 1000 default 1000
endif # EXAMPLES_NOTE endif # SYSTEM_NOTE

View File

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# apps/examples/note/Makefile # apps/system/note/Makefile
# #
# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Copyright (C) 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
@ -37,12 +37,12 @@
# LED driver test built-in application info # LED driver test built-in application info
CONFIG_EXAMPLES_NOTE_PRIORITY ?= SCHED_PRIORITY_DEFAULT CONFIG_SYSTEM_NOTE_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_EXAMPLES_NOTE_STACKSIZE ?= 2048 CONFIG_SYSTEM_NOTE_STACKSIZE ?= 2048
APPNAME = note APPNAME = note
PRIORITY = $(CONFIG_EXAMPLES_NOTE_PRIORITY) PRIORITY = $(CONFIG_SYSTEM_NOTE_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_NOTE_STACKSIZE) STACKSIZE = $(CONFIG_SYSTEM_NOTE_STACKSIZE)
# LED driver test # LED driver test
@ -50,7 +50,7 @@ ASRCS =
CSRCS = CSRCS =
MAINSRC = note_main.c MAINSRC = note_main.c
CONFIG_EXAMPLES_NOTE_PROGNAME ?= note$(EXEEXT) CONFIG_SYSTEM_NOTE_PROGNAME ?= note$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_NOTE_PROGNAME) PROGNAME = $(CONFIG_SYSTEM_NOTE_PROGNAME)
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* examples/note/note_main.c * system/note/note_main.c
* *
* Copyright (C) 2016 Gregory Nutt. All rights reserved. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@ -54,7 +54,7 @@
****************************************************************************/ ****************************************************************************/
static bool g_note_daemon_started; static bool g_note_daemon_started;
static uint8_t g_note_buffer[CONFIG_EXAMPLES_NOTE_BUFFERSIZE]; static uint8_t g_note_buffer[CONFIG_SYSTEM_NOTE_BUFFERSIZE];
/* Names of task/thread states */ /* Names of task/thread states */
@ -377,13 +377,13 @@ static int note_daemon(int argc, char *argv[])
for (; ; ) for (; ; )
{ {
nread = read(fd, g_note_buffer, CONFIG_EXAMPLES_NOTE_BUFFERSIZE); nread = read(fd, g_note_buffer, CONFIG_SYSTEM_NOTE_BUFFERSIZE);
if (nread > 0) if (nread > 0)
{ {
dump_notes(nread); dump_notes(nread);
} }
usleep(CONFIG_EXAMPLES_NOTE_DELAY * 1000L); usleep(CONFIG_SYSTEM_NOTE_DELAY * 1000L);
} }
(void)close(fd); (void)close(fd);
@ -422,8 +422,8 @@ int note_main(int argc, FAR char *argv[])
ledargv[0] = "note_daemon"; ledargv[0] = "note_daemon";
ledargv[1] = NULL; ledargv[1] = NULL;
ret = task_create("note_daemon", CONFIG_EXAMPLES_NOTE_PRIORITY, ret = task_create("note_daemon", CONFIG_SYSTEM_NOTE_PRIORITY,
CONFIG_EXAMPLES_NOTE_STACKSIZE, note_daemon, CONFIG_SYSTEM_NOTE_STACKSIZE, note_daemon,
(FAR char * const *)ledargv); (FAR char * const *)ledargv);
if (ret < 0) if (ret < 0)
{ {

View File

@ -1,4 +1,4 @@
**************************************************************************** /****************************************************************************
* apps/system/zmodem/host/ascii.h * apps/system/zmodem/host/ascii.h
* ASCII Control Codes * ASCII Control Codes
* *