]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Signal compilation error when no known is defined
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Jun 2015 17:23:52 +0000 (19:23 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Jun 2015 17:29:43 +0000 (19:29 +0200)
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.

rpp/include/drv/drv.h
rpp/include/hal/hal.h
rpp/include/rpp/rpp.h

index cd03b0562ad436b56cacda90d686d8508db222ff..76b1027c98fd7f4cae4a930c339f820725abc629 100644 (file)
@@ -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 <carlos@jenkins.co.cr>
  */
 
 #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 */
index 365148cdbb2a69fff36038a1e59a7e136d3780e9..211ec36bddef3480ec7b9a73ed87bd0fad4688cc 100644 (file)
@@ -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 <carlos@jenkins.co.cr>
  */
 
 #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 */
index f641616f7fe741db9aaf3abaa5f883a33cf22979..d1d4262d7900bfe10ebc6fe42eca7131ca7b0b9f 100644 (file)
@@ -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 <carlos@jenkins.co.cr>
  */
 #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 */