Remove canutils/libuavcan and examples/uavcan. libuavcan has not built for a year or so. The basic problem is that as NuttX advances, the old frozen versino of libuavcan has become absolute because it violates the portable POSIX OS interface. No one is maintaining the port so there is no alternative but to remove it.

This commit is contained in:
Gregory Nutt 2018-03-23 07:29:06 -06:00
parent 96b034d18d
commit 28ce015fbb
13 changed files with 1 additions and 948 deletions

View File

@ -1,6 +0,0 @@
/.built
/dsdlc_generated
/libuavcan
/libuavcan-*
/dsdl-*
/pyuavcan-*

View File

@ -1,232 +0,0 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config CANUTILS_LIBUAVCAN
bool "libuavcan Library"
default n
depends on STM32_HAVE_CAN1
depends on !STM32_CAN1
depends on !STM32_CAN2
depends on !STM32_TIM2 || (STM32_HAVE_TIM3 && !STM32_TIM3) || (STM32_HAVE_TIM4 && !STM32_TIM4) || (STM32_HAVE_TIM5 && !STM32_TIM5) || (STM32_HAVE_TIM6 && !STM32_TIM6) || (STM32_HAVE_TIM7 && !STM32_TIM7)
depends on C99_BOOL8
depends on HAVE_CXX
depends on !DISABLE_POLL
---help---
Enables support for the libuavcan library.
if CANUTILS_LIBUAVCAN
config LIBUAVCAN_URL
string "libuavcan URL"
default "https://github.com/UAVCAN/libuavcan/archive"
---help---
libuavcan URL.
config LIBUAVCAN_VERSION
string "libuavcan Version"
default "b04396ace50155573e545ed9bf2fb09964ee2367"
---help---
libuavcan version.
config LIBUAVCAN_DSDL_URL
string "DSDL URL"
default "https://github.com/UAVCAN/dsdl/archive"
---help---
DSDL URL.
config LIBUAVCAN_DSDL_VERSION
string "DSDL Version"
default "9804a3e6972825586be252ce08dd899f44994b14"
---help---
DSDL version.
config LIBUAVCAN_PYUAVCAN_URL
string "pyuavcan URL"
default "https://github.com/UAVCAN/pyuavcan/archive"
---help---
pyuavcan URL.
config LIBUAVCAN_PYUAVCAN_VERSION
string "pyuavcan Version"
default "c58477a644d20ccf95a20c151f3a0402f271c3b8"
---help---
pyuavcan version.
config LIBUAVCAN_STM32_NUM_IFACES
int "Number of CAN Interfaces"
default 1
range 1 1 if !STM32_HAVE_CAN2
range 1 2 if STM32_HAVE_CAN2
choice
prompt "Timer"
default LIBUAVCAN_STM32_TIM2 if !STM32_TIM2
default LIBUAVCAN_STM32_TIM3 if STM32_HAVE_TIM3 && !STM32_TIM3
default LIBUAVCAN_STM32_TIM4 if STM32_HAVE_TIM4 && !STM32_TIM4
default LIBUAVCAN_STM32_TIM5 if STM32_HAVE_TIM5 && !STM32_TIM5
default LIBUAVCAN_STM32_TIM6 if STM32_HAVE_TIM6 && !STM32_TIM6
default LIBUAVCAN_STM32_TIM7 if STM32_HAVE_TIM7 && !STM32_TIM7
config LIBUAVCAN_STM32_TIM2
bool "TIM2"
depends on !STM32_TIM2
---help---
The library will use TIM2.
config LIBUAVCAN_STM32_TIM3
bool "TIM3"
depends on STM32_HAVE_TIM3 && !STM32_TIM3
---help---
The library will use TIM3.
config LIBUAVCAN_STM32_TIM4
bool "TIM4"
depends on STM32_HAVE_TIM4 && !STM32_TIM4
---help---
The library will use TIM4.
config LIBUAVCAN_STM32_TIM5
bool "TIM5"
depends on STM32_HAVE_TIM5 && !STM32_TIM5
---help---
The library will use TIM5.
config LIBUAVCAN_STM32_TIM6
bool "TIM6"
depends on STM32_HAVE_TIM6 && !STM32_TIM6
---help---
The library will use TIM6.
config LIBUAVCAN_STM32_TIM7
bool "TIM7"
depends on STM32_HAVE_TIM7 && !STM32_TIM7
---help---
The library will use TIM7.
endchoice
choice
prompt "C++ Version"
default LIBUAVCAN_CPP03
config LIBUAVCAN_CPP03
bool "C++03"
---help---
The library will use C++03.
config LIBUAVCAN_CPP11
bool "C++11"
---help---
The library will use C++11.
endchoice
config LIBUAVCAN_DEBUG
bool "Debug"
default n
---help---
Enables debug.
config LIBUAVCAN_EXCEPTIONS
bool "Exceptions"
default n
---help---
Enables exceptions.
config LIBUAVCAN_TINY
bool "Tiny"
default n
---help---
Removes some features to save memory.
config LIBUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY
bool "No Global Data Type Registry"
default n
---help---
Removes the global data type registry.
config LIBUAVCAN_TOSTRING
bool "Implement toString"
default n
depends on LIBUAVCAN_EXCEPTIONS
---help---
The library will add a toString method to most of its classes.
config LIBUAVCAN_IMPLEMENT_PLACEMENT_NEW
bool "Implement Placement new"
default n
---help---
The library will implement placement new.
config LIBUAVCAN_USE_EXTERNAL_SNPRINTF
bool "Use External snprintf"
default n
---help---
The library will use an external snprintf.
config LIBUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION
bool "Use External float16 Conversion"
default n
---help---
The library will use an external float16 conversion.
config LIBUAVCAN_NO_ASSERTIONS
bool "No Assertions"
default n
---help---
Disables assertions.
config LIBUAVCAN_MEM_POOL_BLOCK_SIZE
int "Memory Pool Block Size"
default 0
---help---
Specifies the memory pool block size. If the value is 0, the
library will use a default value.
config LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT
int "Float Comparion Epsilon Mult"
default 0
---help---
Specifies the float comparison epsilon mult. If the value is
0, the library will use a default value.
config LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS
int "Max CAN Acceptance Filters"
default 0
---help---
Specifies the maximum number of CAN acceptance filters. If
the value is 0, the library will use a default value.
config LIBUAVCAN_MAX_NETWORK_SIZE_HINT
int "Max Network Size Hint"
default 0
---help---
Specifies the maximum network size. If the value is 0, the
library will use a default value.
config LIBUAVCAN_RX_QUEUE_CAPACITY
int "Rx Queue Capacity"
default 0
---help---
Specifies the rx queue capacity. If the value is 0, the
library will use a default value.
config LIBUAVCAN_BIT_RATE
int "Bit Rate"
default 0
range 0 1000000
---help---
Specifies the CAN bit rate. If the value is 0, the library
will automatically detect the bit rate.
config LIBUAVCAN_INIT_RETRIES
int "Initialization Retries"
default 0
---help---
Specifies the number of times to try initializing the CAN
peripherals before panicking. A value of 0 means to try
forever.
endif

View File

@ -1,38 +0,0 @@
############################################################################
# apps/canutils/libuavcan/Make.defs
#
# Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
# Author: 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.
#
############################################################################
ifeq ($(CONFIG_CANUTILS_LIBUAVCAN),y)
CONFIGURED_APPS += canutils/libuavcan
endif

View File

@ -1,272 +0,0 @@
############################################################################
# apps/canutils/libuavcan/Makefile
#
# Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
# Author: 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)/.config
-include $(TOPDIR)/Make.defs
DELIM ?= $(strip /)
include $(APPDIR)$(DELIM)Make.defs
WGET = wget
UNPACK = unzip
PACKEXT = .zip
LIBUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_URL)))
LIBUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_VERSION)))
LIBUAVCAN_UNPACKNAME = libuavcan-$(LIBUAVCAN_VERSION)
LIBUAVCAN_PACKNAME = $(LIBUAVCAN_UNPACKNAME)$(PACKEXT)
LIBUAVCAN_DSDL_PATH = libuavcan$(DELIM)dsdl
LIBUAVCAN_PYUAVCAN_PATH = libuavcan$(DELIM)libuavcan$(DELIM)dsdl_compiler$(DELIM)pyuavcan
LIBUAVCAN_PATCHNAME = nuttx-$(LIBUAVCAN_VERSION).patch
DSDL_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_DSDL_URL)))
DSDL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_DSDL_VERSION)))
DSDL_UNPACKNAME = dsdl-$(DSDL_VERSION)
DSDL_PACKNAME = $(DSDL_UNPACKNAME)$(PACKEXT)
PYUAVCAN_URL = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_PYUAVCAN_URL)))
PYUAVCAN_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBUAVCAN_PYUAVCAN_VERSION)))
PYUAVCAN_UNPACKNAME = pyuavcan-$(PYUAVCAN_VERSION)
PYUAVCAN_PACKNAME = $(PYUAVCAN_UNPACKNAME)$(PACKEXT)
-include libuavcan$(DELIM)libuavcan$(DELIM)include.mk
-include libuavcan$(DELIM)libuavcan_drivers$(DELIM)stm32$(DELIM)driver$(DELIM)include.mk
CXXSRCS = platform_stm32.cpp $(LIBUAVCAN_SRC) $(LIBUAVCAN_STM32_SRC)
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(LIBUAVCAN_INC)"}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(LIBUAVCAN_STM32_INC)"}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" dsdlc_generated}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(TOPDIR)$(DELIM)arch$(DELIM)arm$(DELIM)src$(DELIM)common"}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(TOPDIR)$(DELIM)arch$(DELIM)arm$(DELIM)src$(DELIM)stm32"}
CXXFLAGS += -D__KERNEL__
CXXFLAGS += -DUAVCAN_STM32_NUTTX=1
CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=$(CONFIG_LIBUAVCAN_STM32_NUM_IFACES)
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM2),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=2
else
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM3),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=3
else
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM4),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=4
else
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM5),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=5
else
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM6),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=6
else
ifeq ($(CONFIG_LIBUAVCAN_STM32_TIM7),y)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=7
endif
endif
endif
endif
endif
endif
ifeq ($(CONFIG_LIBUAVCAN_CPP03),y)
CXXFLAGS += -std=c++03 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03
else
ifeq ($(CONFIG_LIBUAVCAN_CPP11),y)
CXXFLAGS += -std=c++11 -DUAVCAN_CPP_VERSION=UAVCAN_CPP11
endif
endif
ifeq ($(CONFIG_LIBUAVCAN_DEBUG),y)
CXXFLAGS += -DUAVCAN_DEBUG=1
endif
ifeq ($(CONFIG_LIBUAVCAN_EXCEPTIONS),y)
CXXFLAGS += -DUAVCAN_EXCEPTIONS=1
else
CXXFLAGS += -DUAVCAN_EXCEPTIONS=0
endif
ifeq ($(CONFIG_LIBUAVCAN_TINY),y)
CXXFLAGS += -DUAVCAN_TINY=1
endif
ifeq ($(CONFIG_LIBUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY),y)
CXXFLAGS += -DUAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY=1
endif
ifeq ($(CONFIG_LIBUAVCAN_TOSTRING),y)
CXXFLAGS += -DUAVCAN_TOSTRING=1
else
CXXFLAGS += -DUAVCAN_TOSTRING=0
endif
ifeq ($(CONFIG_LIBUAVCAN_IMPLEMENT_PLACEMENT_NEW),y)
CXXFLAGS += -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1
endif
ifeq ($(CONFIG_LIBUAVCAN_USE_EXTERNAL_SNPRINTF),y)
CXXFLAGS += -DUAVCAN_USE_EXTERNAL_SNPRINTF=1
endif
ifeq ($(CONFIG_LIBUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION),y)
CXXFLAGS += -DUAVCAN_USE_EXTERNAL_FLOAT16_CONVERSION=1
endif
ifeq ($(CONFIG_LIBUAVCAN_NO_ASSERTIONS),y)
CXXFLAGS += -DUAVCAN_NO_ASSERTIONS=1
endif
ifneq ($(CONFIG_LIBUAVCAN_MEM_POOL_BLOCK_SIZE),0)
CXXFLAGS += -DUAVCAN_MEM_POOL_BLOCK_SIZE=$(CONFIG_LIBUAVCAN_MEM_POOL_BLOCK_SIZE)
endif
ifneq ($(CONFIG_LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT),0)
CXXFLAGS += -DUAVCAN_FLOAT_COMPARISON_EPSILON_MULT=$(CONFIG_LIBUAVCAN_FLOAT_COMPARISON_EPSILON_MULT)
endif
ifneq ($(CONFIG_LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS),0)
CXXFLAGS += -DUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS=$(CONFIG_LIBUAVCAN_MAX_CAN_ACCEPTANCE_FILTERS)
endif
ifneq ($(CONFIG_LIBUAVCAN_MAX_NETWORK_SIZE_HINT),0)
CXXFLAGS += -DUAVCAN_MAX_NETWORK_SIZE_HINT=$(CONFIG_LIBUAVCAN_MAX_NETWORK_SIZE_HINT)
endif
CXXEXT = .cpp
CXXOBJS = $(CXXSRCS:$(CXXEXT)=$(OBJEXT))
ifeq ($(WINTOOL),y)
BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}"
else
BIN = $(APPDIR)$(DELIM)libapps$(LIBEXT)
endif
DEPBIN = $(APPDIR)/libapps$(LIBEXT)
ROOTDEPPATH = --dep-path .
VPATH =
all: .built
.PHONY: clean depend distclean preconfig
.PRECIOUS: ../../libapps$(LIBEXT)
$(LIBUAVCAN_PACKNAME):
@echo "Downloading: $@"
$(Q) $(WGET) -O $@ $(LIBUAVCAN_URL)$(DELIM)$(LIBUAVCAN_VERSION)$(PACKEXT)
$(LIBUAVCAN_UNPACKNAME): $(LIBUAVCAN_PACKNAME)
@echo "Unpacking: $< -> $@"
$(call DELDIR, $@)
$(Q) $(UNPACK) $<
$(Q) touch $@
$(DSDL_PACKNAME):
@echo "Downloading: $@"
$(Q) $(WGET) -O $@ $(DSDL_URL)$(DELIM)$(DSDL_VERSION)$(PACKEXT)
$(DSDL_UNPACKNAME): $(DSDL_PACKNAME)
@echo "Unpacking: $< -> $@"
$(call DELDIR, $@)
$(Q) $(UNPACK) $<
$(Q) touch $@
$(PYUAVCAN_PACKNAME):
@echo "Downloading: $@"
$(Q) $(WGET) -O $@ $(PYUAVCAN_URL)$(DELIM)$(PYUAVCAN_VERSION)$(PACKEXT)
$(PYUAVCAN_UNPACKNAME): $(PYUAVCAN_PACKNAME)
@echo "Unpacking: $< -> $@"
$(call DELDIR, $@)
$(Q) $(UNPACK) $<
$(Q) touch $@
libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME)
$(call DELDIR, $@)
$(Q) cp -R $(LIBUAVCAN_UNPACKNAME) $@
$(Q) if [ -r $(LIBUAVCAN_PATCHNAME) ]; then \
cat $(LIBUAVCAN_PATCHNAME) | patch -p0 || { echo "ERROR: Patch failed"; exit 1; }; \
fi
$(call DELDIR, $(LIBUAVCAN_DSDL_PATH))
$(Q) cp -R $(DSDL_UNPACKNAME) $(LIBUAVCAN_DSDL_PATH)
$(call DELDIR, $(LIBUAVCAN_PYUAVCAN_PATH))
$(Q) cp -R $(PYUAVCAN_UNPACKNAME) $(LIBUAVCAN_PYUAVCAN_PATH)
$(Q) touch $@
dsdlc_generated: libuavcan
$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR)))
$(APPDIR)$(DELIM)include$(DELIM)uavcan: dsdlc_generated
$(Q) mkdir -p $(APPDIR)$(DELIM)include$(DELIM)uavcan
$(Q) cp -R libuavcan$(DELIM)libuavcan$(DELIM)include$(DELIM)uavcan$(DELIM)* $(APPDIR)$(DELIM)include$(DELIM)uavcan
$(Q) cp -R dsdlc_generated$(DELIM)uavcan$(DELIM)* $(APPDIR)$(DELIM)include$(DELIM)uavcan
$(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
$(call COMPILEXX, $<, $@)
.built: $(CXXOBJS)
$(call ARCHIVE, $(BIN), $(CXXOBJS))
$(Q) touch $@
install:
context: libuavcan
$(Q) $(MAKE) $(APPDIR)$(DELIM)include$(DELIM)uavcan TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
.depend: Makefile $(CXXSRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
$(call DELFILE, .built)
$(foreach CXXOBJ, $(CXXOBJS), $(call DELFILE, $(CXXOBJ)))
$(call DELDIR, dsdlc_generated)
$(call DELDIR, $(APPDIR)$(DELIM)include$(DELIM)uavcan)
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
$(call DELDIR, libuavcan)
$(call DELDIR, $(LIBUAVCAN_UNPACKNAME))
$(call DELFILE, $(LIBUAVCAN_PACKNAME))
$(call DELDIR, $(DSDL_UNPACKNAME))
$(call DELFILE, $(DSDL_PACKNAME))
$(call DELDIR, $(PYUAVCAN_UNPACKNAME))
$(call DELFILE, $(PYUAVCAN_PACKNAME))
preconfig:
-include Make.dep

View File

@ -1,65 +0,0 @@
--- libuavcan/libuavcan_drivers/stm32/driver/src/internal.hpp.orig 2016-02-15 18:43:32.799005338 -0600
+++ libuavcan/libuavcan_drivers/stm32/driver/src/internal.hpp 2016-02-15 18:45:09.621004803 -0600
@@ -9,6 +9,7 @@
#if UAVCAN_STM32_CHIBIOS
# include <hal.h>
#elif UAVCAN_STM32_NUTTX
+# include <nuttx/irq.h>
# include <nuttx/arch.h>
# include <arch/board/board.h>
# include <chip/stm32_tim.h>
@@ -97,12 +98,12 @@
const irqstate_t flags_;
CriticalSectionLocker()
- : flags_(irqsave())
+ : flags_(enter_critical_section())
{ }
~CriticalSectionLocker()
{
- irqrestore(flags_);
+ leave_critical_section(flags_);
}
};
--- 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

View File

@ -1,103 +0,0 @@
/****************************************************************************
* canutils/libuavcan/platform_stm32.cpp
*
* Copyright (C) 2015-2016 Omni Hoverboards Inc. All rights reserved.
* Author: 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <cunistd>
#include <uavcan_stm32/uavcan_stm32.hpp>
/****************************************************************************
* Configuration
****************************************************************************/
#if CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY == 0
# undef CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY
# define CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
static void delay(void)
{
std::usleep(uavcan_stm32::
CanInitHelper<CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY>::
getRecommendedListeningDelay().toUSec());
}
/****************************************************************************
* Public Functions
****************************************************************************/
uavcan::ICanDriver &getCanDriver(void)
{
static uavcan_stm32::CanInitHelper<CONFIG_LIBUAVCAN_RX_QUEUE_CAPACITY> can;
static bool initialized = false;
if (!initialized)
{
uavcan::uint32_t bitrate = CONFIG_LIBUAVCAN_BIT_RATE;
#if CONFIG_LIBUAVCAN_INIT_RETRIES > 0
int retries = 0;
#endif
while (can.init(delay, bitrate) < 0)
{
#if CONFIG_LIBUAVCAN_INIT_RETRIES > 0
retries++;
if (retries >= CONFIG_LIBUAVCAN_INIT_RETRIES)
{
PANIC();
}
#endif
}
initialized = true;
}
return can.driver;
}
uavcan::ISystemClock &getSystemClock(void)
{
return uavcan_stm32::SystemClock::instance();
}

View File

@ -2005,12 +2005,6 @@ examples/touchscreen
int board_tsc_setup(int minor); int board_tsc_setup(int minor);
examples/uavcan
^^^^^^^^^^^^^^^
Illustrates use of canutils/uavcan. Contributed by Paul Alexander
Patience.
examples/udp examples/udp
^^^^^^^^^^^^ ^^^^^^^^^^^^

View File

@ -1,11 +0,0 @@
/Make.dep
/.depend
/.built
/*.asm
/*.obj
/*.rel
/*.lst
/*.sym
/*.adb
/*.lib
/*.src

View File

@ -1,34 +0,0 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config EXAMPLES_UAVCAN
bool "UAVCAN example"
default n
depends on CANUTILS_LIBUAVCAN
---help---
Enable the UAVCAN example
if EXAMPLES_UAVCAN
config EXAMPLES_UAVCAN_NODE_MEM_POOL_SIZE
int "Node Memory Pool Size"
default 4096
---help---
Specifies the node's memory pool size
config EXAMPLES_UAVCAN_NODE_ID
int "Node ID"
default 1
range 1 127
---help---
Specifies the node's ID
config EXAMPLES_UAVCAN_NODE_NAME
string "Node Name"
default "org.nuttx.apps.examples.uavcan"
---help---
Specifies the node's name
endif

View File

@ -1,39 +0,0 @@
############################################################################
# apps/examples/uavcan/Make.defs
# Adds selected applications to apps/ build
#
# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
# Author: 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.
#
############################################################################
ifeq ($(CONFIG_EXAMPLES_UAVCAN),y)
CONFIGURED_APPS += examples/uavcan
endif

View File

@ -1,44 +0,0 @@
############################################################################
# apps/examples/uavcan/Makefile
#
# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
# Author: 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
APPNAME = uavcan
MAINSRC = uavcan_main.cxx
CXXFLAGS += -I$(TOPDIR)/include/apps
include $(APPDIR)/Application.mk

View File

@ -1,97 +0,0 @@
/****************************************************************************
* examples/uavcan/uavcan_main.cxx
*
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
* Author: 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <cstdio>
#include <cstdlib>
#include "platform/cxxinitialize.h"
#include <uavcan/uavcan.hpp>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
extern uavcan::ICanDriver &getCanDriver(void);
extern uavcan::ISystemClock &getSystemClock(void);
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: uavcan_main
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
extern "C" int uavcan_main(int argc, FAR char *argv[])
#endif
{
up_cxxinitialize();
static uavcan::Node<CONFIG_EXAMPLES_UAVCAN_NODE_MEM_POOL_SIZE>
node(getCanDriver(), getSystemClock());
node.setNodeID(CONFIG_EXAMPLES_UAVCAN_NODE_ID);
node.setName(CONFIG_EXAMPLES_UAVCAN_NODE_NAME);
int ret = node.start();
if (ret < 0)
{
std::fprintf(stderr, "ERROR: node.start failed: %d\n", ret);
return EXIT_FAILURE;
}
node.setModeOperational();
for (;;)
{
ret = node.spin(uavcan::MonotonicDuration::fromMSec(100));
if (ret < 0)
{
std::fprintf(stderr, "ERROR: node.spin failed: %d\n", ret);
}
}
return EXIT_SUCCESS;
}

2
include/.gitignore vendored
View File

@ -1,2 +1,2 @@
/pcode /pcode
/uavcan