libuavcan: Rename uavcan to libuavcan
This commit is contained in:
parent
eb1533ffc2
commit
1df46096ff
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
menu "CAN Utilities"
|
menu "CAN Utilities"
|
||||||
|
|
||||||
source "$APPSDIR/canutils/uavcan/Kconfig"
|
|
||||||
source "$APPSDIR/canutils/libcanard/Kconfig"
|
source "$APPSDIR/canutils/libcanard/Kconfig"
|
||||||
|
source "$APPSDIR/canutils/libuavcan/Kconfig"
|
||||||
|
|
||||||
endmenu # CAN Utilities
|
endmenu # CAN Utilities
|
||||||
|
@ -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 "b04396ace50155573e545ed9bf2fb09964ee2367"
|
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---
|
@ -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
|
@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# apps/canutils/uavcan/Makefile
|
# apps/canutils/libuavcan/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2015-2016 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>
|
||||||
@ -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
|
||||||
@ -212,6 +212,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)))
|
||||||
@ -248,7 +249,6 @@ clean:
|
|||||||
distclean: clean
|
distclean: clean
|
||||||
$(call DELFILE, Make.dep)
|
$(call DELFILE, Make.dep)
|
||||||
$(call DELFILE, .depend)
|
$(call DELFILE, .depend)
|
||||||
$(call DELFILE, .libuavcan_patched)
|
|
||||||
$(call DELDIR, $(LIBUAVCAN_UNPACKNAME))
|
$(call DELDIR, $(LIBUAVCAN_UNPACKNAME))
|
||||||
$(call DELFILE, $(LIBUAVCAN_PACKNAME))
|
$(call DELFILE, $(LIBUAVCAN_PACKNAME))
|
||||||
$(call DELDIR, $(DSDL_UNPACKNAME))
|
$(call DELDIR, $(DSDL_UNPACKNAME))
|
@ -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();
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user