2016-11-23 19:05:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 OTA keys S.A.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-06-06 10:32:32 +02:00
|
|
|
* @ingroup sys_auto_init
|
2016-11-23 19:05:35 +01:00
|
|
|
* @{
|
|
|
|
* @file
|
|
|
|
* @brief initializes can device init function
|
|
|
|
*
|
|
|
|
* @author Toon Stegen <toon.stegen@altran.com>
|
|
|
|
* @author Vincent Dupont <vincent@otakeys.com>
|
|
|
|
* @author Aurelien Gonce <aurelien.gonce@altran.com>
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define ENABLE_DEBUG (0)
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
#include "can/dll.h"
|
|
|
|
|
2016-11-23 19:08:30 +01:00
|
|
|
#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
|
|
|
|
|
2016-11-23 19:05:35 +01:00
|
|
|
void auto_init_candev(void)
|
|
|
|
{
|
|
|
|
DEBUG("auto_init_can: init dll\n");
|
|
|
|
can_dll_init();
|
2016-11-23 19:08:30 +01:00
|
|
|
|
|
|
|
#ifdef MODULE_CAN_ISOTP
|
|
|
|
DEBUG("auto_init_can: init isotp\n");
|
|
|
|
isotp_init(isotp_stack, ISOTP_STACK_SIZE, ISOTP_PRIORITY, "isotp");
|
|
|
|
#endif
|
|
|
|
|
2016-11-23 19:06:59 +01:00
|
|
|
#ifdef MODULE_CAN_LINUX
|
|
|
|
extern void auto_init_can_native(void);
|
|
|
|
auto_init_can_native();
|
|
|
|
#endif
|
2018-10-08 12:20:49 +02:00
|
|
|
|
2016-11-24 16:29:33 +01:00
|
|
|
#ifdef MODULE_PERIPH_CAN
|
|
|
|
extern void auto_init_periph_can(void);
|
|
|
|
auto_init_periph_can();
|
|
|
|
#endif
|
2016-11-23 19:05:35 +01:00
|
|
|
}
|