Skip to content

Commit

Permalink
Merge pull request #15407 from leandrolanzieri/pr/native/periph/remov…
Browse files Browse the repository at this point in the history
…e_unused_can

cpu/native: remove unused can_linux module
  • Loading branch information
aabadie authored Nov 13, 2020
2 parents 4c9ee5d + d4be753 commit d91a135
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion boards/native/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ endif

ifneq (,$(filter periph_can,$(FEATURES_USED)))
ifeq ($(OS),Linux)
USEMODULE += can_linux
CFLAGS += -DCAN_DLL_NUMOF=2
endif
endif
Expand Down
3 changes: 0 additions & 3 deletions cpu/native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ ifneq (,$(filter mtd_native,$(USEMODULE)))
DIRS += mtd
endif

ifneq (,$(filter can_linux,$(USEMODULE)))
DIRS += can
endif
ifneq (,$(filter backtrace,$(USEMODULE)))
DIRS += backtrace
endif
Expand Down
2 changes: 1 addition & 1 deletion cpu/native/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ifeq ($(BUILDOSXNATIVE),1)
NATIVEINCLUDES += -I$(RIOTCPU)/native/osx-libc-extra
endif

ifneq (,$(filter can_linux,$(USEMODULE)))
ifneq (,$(filter periph_can,$(USEMODULE)))
LINKFLAGS += -lsocketcan
endif

Expand Down
3 changes: 0 additions & 3 deletions cpu/native/can/Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion cpu/native/periph/can.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
*/

#if !defined(__linux__)
#error "MODULE can_linux is only available on Linux"
#error "Usage of periph_can on RIOT native requires libsocketcan. Currently \
this is only available on Linux"
#else

#include <string.h>
Expand Down
10 changes: 5 additions & 5 deletions cpu/native/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ netdev_tap_params_t netdev_tap_params[NETDEV_TAP_MAX];
#include "board.h"
#include "mtd_native.h"
#endif
#ifdef MODULE_CAN_LINUX
#ifdef MODULE_PERIPH_CAN
#include "candev_linux.h"
#endif
#ifdef MODULE_PERIPH_SPIDEV_LINUX
Expand All @@ -101,7 +101,7 @@ static const char short_opts[] = ":hi:s:deEoc:"
#ifdef MODULE_MTD_NATIVE
"m:"
#endif
#ifdef MODULE_CAN_LINUX
#ifdef MODULE_PERIPH_CAN
"n:"
#endif
#ifdef MODULE_SOCKET_ZEP
Expand All @@ -127,7 +127,7 @@ static const struct option long_opts[] = {
#ifdef MODULE_MTD_NATIVE
{ "mtd", required_argument, NULL, 'm' },
#endif
#ifdef MODULE_CAN_LINUX
#ifdef MODULE_PERIPH_CAN
{ "can", required_argument, NULL, 'n' },
#endif
#ifdef MODULE_SOCKET_ZEP
Expand Down Expand Up @@ -327,7 +327,7 @@ void usage_exit(int status)
" -m <mtd>, --mtd=<mtd>\n"
" specify the file name of mtd emulated device\n");
#endif
#if defined(MODULE_CAN_LINUX)
#if defined(MODULE_PERIPH_CAN)
real_printf(
" -n <ifnum>:<ifname>, --can <ifnum>:<ifname>\n"
" specify CAN interface <ifname> to use for CAN device #<ifnum>\n"
Expand Down Expand Up @@ -504,7 +504,7 @@ __attribute__((constructor)) static void startup(int argc, char **argv, char **e
((mtd_native_dev_t *)mtd0)->fname = strndup(optarg, PATH_MAX - 1);
break;
#endif
#if defined(MODULE_CAN_LINUX)
#if defined(MODULE_PERIPH_CAN)
case 'n':{
int i;
i = atol(optarg);
Expand Down

0 comments on commit d91a135

Please sign in to comment.