From: Michal Sojka Date: Tue, 30 Jun 2015 17:23:52 +0000 (+0200) Subject: Signal compilation error when no known is defined X-Git-Tag: eaton-0.5-beta~13 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lib.git/commitdiff_plain/5ac6881469163ea97515cb113e3625b156793a73 Signal compilation error when no known is defined Files that include target specific header files should fail to compile if no known target is selected. This makes it easier to add new targets, because all places where a modification is needed are reprted by the compiler. --- diff --git a/rpp/include/drv/drv.h b/rpp/include/drv/drv.h index cd03b05..76b1027 100644 --- a/rpp/include/drv/drv.h +++ b/rpp/include/drv/drv.h @@ -3,7 +3,7 @@ * * @file drv.h * - * @copyright Copyright (C) 2013 Czech Technical University in Prague + * @copyright Copyright (C) 2013, 2015 Czech Technical University in Prague * * @author Carlos Jenkins */ @@ -13,12 +13,16 @@ #include "hal/hal.h" -#ifdef TARGET_RM48_HDK +#if defined(TARGET_RM48_HDK) #include "drv/_rm48_hdk/adc.h" -#endif /* TARGET_RM48_HDK */ -#ifdef TARGET_TMS570_HDK +#elif defined(TARGET_TMS570_HDK) #include "drv/_tms570_hdk/adc.h" -#endif /* TARGET_TMS570_HDK */ +#elif defined(TARGET_TMS570_HYDCTR) +#include "drv/_tms570_hydctr/adc.h" +#else +#error No supported target specified! +#endif /* TARGET */ + #include "drv/sci.h" #endif /* __DRV_H */ diff --git a/rpp/include/hal/hal.h b/rpp/include/hal/hal.h index 365148c..211ec36 100644 --- a/rpp/include/hal/hal.h +++ b/rpp/include/hal/hal.h @@ -3,7 +3,7 @@ * * @file hal.h * - * @copyright Copyright (C) 2013 Czech Technical University in Prague + * @copyright Copyright (C) 2013, 2015 Czech Technical University in Prague * * @author Carlos Jenkins */ @@ -13,25 +13,23 @@ #include "sys/sys.h" -#ifdef FREERTOS_POSIX +#if defined(TARGET_POSIX) #include "hal/_rm48_hdk/gpio_def.h" #include "hal/_rm48_hdk/port_def.h" -#include "hal/gpio.h" -#include "hal/port_gpio.h" -#endif /* FREERTOS_POSIX */ - -#ifdef TARGET_RM48_HDK +#elif defined(TARGET_RM48_HDK) #include "hal/_rm48_hdk/gpio_def.h" #include "hal/_rm48_hdk/port_def.h" -#include "hal/gpio.h" -#include "hal/port_gpio.h" -#endif /* TARGET_RM48_HDK */ - -#ifdef TARGET_TMS570_HDK +#elif defined(TARGET_TMS570_HDK) #include "hal/_tms570_hdk/gpio_def.h" #include "hal/_tms570_hdk/port_def.h" +#elif defined(TARGET_TMS570_HYDCTR) +#include "hal/_tms570_hydctr/gpio_def.h" +#include "hal/_tms570_hydctr/port_def.h" +#else +#error No supported target specified! +#endif + #include "hal/gpio.h" #include "hal/port_gpio.h" -#endif /* TARGET_TMS570_HDK */ #endif /* __HAL_H */ diff --git a/rpp/include/rpp/rpp.h b/rpp/include/rpp/rpp.h index f641616..d1d4262 100644 --- a/rpp/include/rpp/rpp.h +++ b/rpp/include/rpp/rpp.h @@ -3,7 +3,7 @@ * * @file rpp.h * - * @copyright Copyright (C) 2013, 2014 Czech Technical University in Prague + * @copyright Copyright (C) 2013, 2014, 2015 Czech Technical University in Prague * * @author Carlos Jenkins */ @@ -16,25 +16,23 @@ #include "base.h" /* Include modules */ -#ifdef FREERTOS_POSIX +#if defined(TARGET_POSIX) #include "rpp/_rm48_hdk/adc.h" #include "rpp/can.h" #include "rpp/sci.h" #include "rpp/sci_posix.h" -#endif - -#ifdef TARGET_RM48_HDK +#elif defined(TARGET_RM48_HDK) #include "rpp/_rm48_hdk/adc.h" #include "rpp/can.h" #include "rpp/sci.h" #include "rpp/gio.h" -#endif /* TARGET_RM48_HDK */ - -#ifdef TARGET_TMS570_HDK +#elif defined(TARGET_TMS570_HDK) || defined(TARGET_TMS570_HYDCTR) #include "rpp/_tms570_hdk/adc.h" #include "rpp/can.h" #include "rpp/sci.h" #include "rpp/gio.h" +#else +#error No supported target specified! #endif /* TARGET_TMS570_HDK */