Skip to content

Commit

Permalink
can: add ISO-TP support
Browse files Browse the repository at this point in the history
ISO-TP is ISO15765 transport protocol over CAN.
Upper interface is located in sys/include/can/isotp.h.
  • Loading branch information
Vincent Dupont committed Jun 19, 2017
1 parent 68f1ea8 commit 63ca443
Show file tree
Hide file tree
Showing 6 changed files with 1,126 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile.dep
Expand Up @@ -579,6 +579,10 @@ ifneq (,$(filter can,$(USEMODULE)))
USEMODULE += gnrc_pktbuf_static
endif

ifneq (,$(filter can_isotp,$(USEMODULE)))
USEMODULE += xtimer
endif

ifneq (,$(filter random,$(USEMODULE)))
# select default prng
ifeq (,$(filter prng_%,$(USEMODULE)))
Expand Down
20 changes: 20 additions & 0 deletions sys/auto_init/can/auto_init_can.c
Expand Up @@ -25,10 +25,30 @@

#include "can/dll.h"

#ifdef MODULE_CAN_ISOTP
#include "can/isotp.h"

#ifndef ISOTP_STACK_SIZE
#define ISOTP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
#endif

#ifndef ISOTP_PRIORITY
#define ISOTP_PRIORITY (THREAD_PRIORITY_MAIN - 2)
#endif

static char isotp_stack[ISOTP_STACK_SIZE];
#endif

void auto_init_candev(void)
{
DEBUG("auto_init_can: init dll\n");
can_dll_init();

#ifdef MODULE_CAN_ISOTP
DEBUG("auto_init_can: init isotp\n");
isotp_init(isotp_stack, ISOTP_STACK_SIZE, ISOTP_PRIORITY, "isotp");
#endif

#ifdef MODULE_CAN_LINUX
extern void auto_init_can_native(void);
auto_init_can_native();
Expand Down
5 changes: 5 additions & 0 deletions sys/can/Makefile
@@ -1 +1,6 @@

ifneq (,$(filter can_isotp,$(USEMODULE)))
DIRS += isotp
endif

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions sys/can/isotp/Makefile
@@ -0,0 +1,3 @@
MODULE = can_isotp

include $(RIOTBASE)/Makefile.base

0 comments on commit 63ca443

Please sign in to comment.