modules: canopennode: move glue code to modules directory
Move the Zephyr-specific interface and support code for CANopenNode into the modules directory. Consolidate the CMakeLists.txt files into one. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
aab30dad6f
commit
d679037643
|
@ -9,7 +9,6 @@ comment "Optional modules. Make sure they're installed, via the project manifest
|
|||
|
||||
source "modules/Kconfig.altera"
|
||||
source "modules/Kconfig.atmel"
|
||||
source "modules/Kconfig.canopennode"
|
||||
source "modules/Kconfig.civetweb"
|
||||
source "modules/Kconfig.cmsis"
|
||||
source "modules/Kconfig.cypress"
|
||||
|
@ -64,6 +63,9 @@ comment "Lz4 module not available."
|
|||
comment "loramac-node module not available."
|
||||
depends on !ZEPHYR_LORAMAC_NODE_MODULE
|
||||
|
||||
comment "CANopenNode module not available."
|
||||
depends on !ZEPHYR_CANOPENNODE_MODULE
|
||||
|
||||
# This ensures that symbols are available in Kconfig for dependency checking
|
||||
# and referencing, while keeping the settings themselves unavailable when the
|
||||
# modules are not present in the workspace
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# CANopenNode CANopen protocol stack
|
||||
|
||||
# Copyright (c) 2019 Vestas Wind System A/S
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config CANOPENNODE
|
||||
bool "CANopenNode Support"
|
||||
help
|
||||
This option enables the CANopenNode library.
|
36
modules/canopennode/CMakeLists.txt
Normal file
36
modules/canopennode/CMakeLists.txt
Normal file
|
@ -0,0 +1,36 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(CONFIG_CANOPENNODE)
|
||||
|
||||
set(CANOPENNODE_DIR ${ZEPHYR_CURRENT_MODULE_DIR})
|
||||
|
||||
zephyr_library()
|
||||
|
||||
zephyr_include_directories(
|
||||
${CANOPENNODE_DIR}
|
||||
${CANOPENNODE_DIR}/stack
|
||||
.
|
||||
)
|
||||
|
||||
zephyr_library_sources(
|
||||
${CANOPENNODE_DIR}/CANopen.c
|
||||
${CANOPENNODE_DIR}/stack/CO_Emergency.c
|
||||
${CANOPENNODE_DIR}/stack/CO_HBconsumer.c
|
||||
${CANOPENNODE_DIR}/stack/CO_LSSmaster.c
|
||||
${CANOPENNODE_DIR}/stack/CO_LSSslave.c
|
||||
${CANOPENNODE_DIR}/stack/CO_NMT_Heartbeat.c
|
||||
${CANOPENNODE_DIR}/stack/CO_PDO.c
|
||||
${CANOPENNODE_DIR}/stack/CO_SDO.c
|
||||
${CANOPENNODE_DIR}/stack/CO_SDOmaster.c
|
||||
${CANOPENNODE_DIR}/stack/CO_SYNC.c
|
||||
${CANOPENNODE_DIR}/stack/CO_TIME.c
|
||||
${CANOPENNODE_DIR}/stack/CO_trace.c
|
||||
CO_driver.c
|
||||
)
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_SYNC_THREAD canopen_sync.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_STORAGE canopen_storage.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_LEDS canopen_leds.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_PROGRAM_DOWNLOAD canopen_program.c)
|
||||
|
||||
endif()
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_SUBSYS_CANBUS_CANOPEN_CO_DRIVER_H
|
||||
#define ZEPHYR_SUBSYS_CANBUS_CANOPEN_CO_DRIVER_H
|
||||
#ifndef ZEPHYR_MODULES_CANOPENNODE_CO_DRIVER_H
|
||||
#define ZEPHYR_MODULES_CANOPENNODE_CO_DRIVER_H
|
||||
|
||||
/*
|
||||
* Zephyr RTOS CAN driver interface and configuration for CANopenNode
|
||||
|
@ -120,4 +120,4 @@ void canopen_od_unlock(void);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZEPHYR_SUBSYS_CANBUS_CANOPEN_CO_DRIVER_H */
|
||||
#endif /* ZEPHYR_MODULES_CANOPENNODE_CO_DRIVER_H */
|
|
@ -1,22 +1,18 @@
|
|||
# CANopen configuration options
|
||||
# CANopenNode CANopen protocol stack configuration options
|
||||
|
||||
# Copyright (c) 2019 Vestas Wind Systems A/S
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menuconfig CANOPEN
|
||||
bool "CANopen protocol support"
|
||||
config ZEPHYR_CANOPENNODE_MODULE
|
||||
bool
|
||||
|
||||
config CANOPENNODE
|
||||
bool "CANopenNode support"
|
||||
depends on CAN
|
||||
select CANOPENNODE
|
||||
help
|
||||
Enable CANopen (EN 50325-4) (CiA 301) protocol
|
||||
support. Support is provided by the 3rd party CANopenNode
|
||||
protocol stack.
|
||||
This option enables the CANopenNode library.
|
||||
|
||||
if CANOPEN
|
||||
|
||||
module = CANOPEN
|
||||
module-str = CANOPEN
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
if CANOPENNODE
|
||||
|
||||
config CANOPEN_SDO_BUFFER_SIZE
|
||||
int "CANopen SDO buffer size"
|
||||
|
@ -113,4 +109,4 @@ config CANOPEN_PROGRAM_DOWNLOAD
|
|||
Enable support for program download over CANopen according
|
||||
to the CiA 302-3 (draft) specification.
|
||||
|
||||
endif # CANOPEN
|
||||
endif # CANOPENNODE
|
|
@ -1,4 +1,3 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_CANOPEN canopen)
|
||||
add_subdirectory_ifdef(CONFIG_ISOTP isotp)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
menu "Controller Area Network (CAN) bus subsystem"
|
||||
|
||||
source "subsys/canbus/canopen/Kconfig"
|
||||
source "subsys/canbus/Kconfig.canopen"
|
||||
source "subsys/canbus/isotp/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
19
subsys/canbus/Kconfig.canopen
Normal file
19
subsys/canbus/Kconfig.canopen
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Copyright (c) 2019 - 2021 Vestas Wind Systems A/S
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
menuconfig CANOPEN
|
||||
bool "CANopen protocol support"
|
||||
depends on CAN
|
||||
select CANOPENNODE
|
||||
help
|
||||
Enable CANopen (EN 50325-4) (CiA 301) protocol
|
||||
support. Support is provided by the 3rd party CANopenNode
|
||||
protocol stack.
|
||||
|
||||
if CANOPEN
|
||||
|
||||
module = CANOPEN
|
||||
module-str = CANopen
|
||||
source "subsys/logging/Kconfig.template.log_config"
|
||||
|
||||
endif # CANOPEN
|
|
@ -1,9 +0,0 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
zephyr_library()
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN CO_driver.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_SYNC_THREAD canopen_sync.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_STORAGE canopen_storage.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_LEDS canopen_leds.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_CANOPEN_PROGRAM_DOWNLOAD canopen_program.c)
|
||||
zephyr_include_directories(.)
|
2
west.yml
2
west.yml
|
@ -26,7 +26,7 @@ manifest:
|
|||
# Please add items below based on alphabetical order
|
||||
projects:
|
||||
- name: canopennode
|
||||
revision: 468d350028a975b96563e58344de48281a0ab371
|
||||
revision: f167efe85c8c7de886f1bc47f9173cfb8a346bb5
|
||||
path: modules/lib/canopennode
|
||||
- name: civetweb
|
||||
revision: 094aeb41bb93e9199d24d665ee43e9e05d6d7b1c
|
||||
|
|
Loading…
Reference in a new issue