From fc148266157cab40e8954107a7c2f9e0a6754c3f Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 3 Jul 2015 14:50:28 +0200 Subject: [PATCH] Make DMM code in can.c conditional The reason is that tms570_hydctr does not have DMM. --- rpp/include/sys/ti_drv_dmm.h | 5 +++-- rpp/src/rpp/can.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rpp/include/sys/ti_drv_dmm.h b/rpp/include/sys/ti_drv_dmm.h index b857af2..3a79b8c 100644 --- a/rpp/include/sys/ti_drv_dmm.h +++ b/rpp/include/sys/ti_drv_dmm.h @@ -14,6 +14,8 @@ #include "base.h" #include "sys/ti_drv_gio.h" +#ifdef TARGET_HAS_DMM + #define DMM_SYNC 0 #define DMM_CLK 1 #define DMM_DATA0 2 @@ -104,9 +106,8 @@ typedef volatile struct dmmBase /* DMM Interface Functions */ -#ifdef TARGET_HAS_DMM void dmmInit(void); -#else +#else /* ! TARGET_HAS_DMM */ #define dmmInit() #endif diff --git a/rpp/src/rpp/can.c b/rpp/src/rpp/can.c index ca0e4f3..8e3aea5 100644 --- a/rpp/src/rpp/can.c +++ b/rpp/src/rpp/can.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2013-2014 Czech Technical University in Prague +/* Copyright (C) 2013-2015 Czech Technical University in Prague * * Authors: * - Carlos Jenkins @@ -562,7 +562,7 @@ int8_t rpp_can_init(const struct rpp_can_config *config) { uint16_t i; -#ifndef FREERTOS_POSIX +#ifdef TARGET_HAS_DMM dmmInit(); /* @@ -575,6 +575,7 @@ int8_t rpp_can_init(const struct rpp_can_config *config) dmmREG->PC4 = 1<<13; // set CAN_NSTB dmmREG->PC4 = 1<<15; // set CAN_EN #endif + can_config = config; if (can_reset(canREG1) == FAILURE) -- 2.39.2