Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building using rtkernel with built in cmake #107

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# refer to the root source directory of the project as ${SOES_SOURCE_DIR} and
# to the root binary directory of the project as ${SOES_BINARY_DIR}.
cmake_minimum_required (VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${RTK}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_PREFIX_PATH "${RTK}")
project (SOES)

set (SOES_VERSION_MAJOR 3)
Expand Down
2 changes: 1 addition & 1 deletion applications/rtl_xmc4_dynpdo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* LICENSE file in the project root for full license information
*/

#include <kern.h>
#include <kern/kern.h>
#include "esc.h"
#include "esc_hw.h"
#include "ecat_slv.h"
Expand Down
47 changes: 0 additions & 47 deletions cmake/Platform/rt-kernel.cmake

This file was deleted.

37 changes: 37 additions & 0 deletions cmake/rt-kernel.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

if(${ARCH} STREQUAL "xmc4")
set(SOES_DEMO applications/rtl_xmc4_dynpdo)

include_directories(
${SOES_SOURCE_DIR}/soes/include/sys/gcc
${SOES_SOURCE_DIR}/${SOES_DEMO}
${SOES_SOURCE_DIR}/soes/hal/rt-kernel-xmc4
)

set(HAL_SOURCES
${SOES_SOURCE_DIR}/soes/hal/rt-kernel-xmc4/esc_hw.c
${SOES_SOURCE_DIR}/soes/hal/rt-kernel-xmc4/esc_hw_eep.c
)

endif()

if(${ARCH} STREQUAL "kinetis")
set(SOES_DEMO applications/rtl_slavedemo)

include_directories(
${SOES_SOURCE_DIR}/${SOES_DEMO}
)

set(HAL_SOURCES
${SOES_SOURCE_DIR}/soes/hal/rt-kernel-twrk60/esc_hw.c
)
endif()


find_package(rtkernel REQUIRED)

# Common compile flags
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Werror -fomit-frame-pointer -fno-strict-aliasing)

link_libraries(${BSP} ${ARCH} kern dev sio block fs usb lwip ptpd eth i2c rtc can nand spi nor pwm adc trace counter c m shell)

27 changes: 0 additions & 27 deletions cmake/toolchain/rt-kernel-twrk60.cmake

This file was deleted.

29 changes: 0 additions & 29 deletions cmake/toolchain/rt-kernel-xmc4.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion soes/hal/rt-kernel-xmc4/esc_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Function to read and write commands to the ESC. Used to read/write ESC
* registers and memory.
*/
#include <kern.h>
#include <kern/kern.h>
#include <bsp.h>
#include <xmc4.h>
#include <eru.h>
Expand Down
2 changes: 1 addition & 1 deletion soes/hal/rt-kernel-xmc4/esc_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef __esc_hw__
#define __esc_hw__

#include <kern.h>
#include <kern/kern.h>
/* ================================================================================ */
/* ================ ECAT [ECAT0] ================ */
/* ================================================================================ */
Expand Down
4 changes: 0 additions & 4 deletions soes/include/sys/gcc/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ extern "C"
#define CC_PACKED __attribute__((packed))
#define CC_ALIGNED(n) __attribute__((aligned (n)))

#ifdef __rtk__
#define CC_ASSERT(exp) ASSERT (exp)
#else
#define CC_ASSERT(exp) assert (exp)
#endif
#define CC_STATIC_ASSERT(exp) _Static_assert (exp, "")

#define CC_DEPRECATED __attribute__((deprecated))
Expand Down