]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/src/rpp/rpp.c
Change license to MIT
[pes-rpp/rpp-lib.git] / rpp / src / rpp / rpp.c
index e406485b2f4d4f3b214b795fb441c78e5dc5d117..4937d64f5a7c7bd8b2fcd0c51d93d5fb815d5519 100644 (file)
@@ -1,12 +1,28 @@
-/* Copyright (C) 2013 Czech Technical University in Prague
+/* Copyright (C) 2013, 2015 Czech Technical University in Prague
  *
  * Authors:
  *     - Carlos Jenkins <carlos@jenkins.co.cr>
  *
- * This document contains proprietary information belonging to Czech
- * Technical University in Prague. Passing on and copying of this
- * document, and communication of its contents is not permitted
- * without prior written authorization.
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  *
  * File : rpp.c
  * Abstract:
 
 #include "rpp/rpp.h"
 
-#if rppCONFIG_DRV == 1
+#ifndef FREERTOS_POSIX
 #include "drv/drv.h"
 #endif
 
 static boolean_t rpp_initialized = FALSE;
 
-int8_t rpp_init() {
+int8_t rpp_init()
+{
 
-    if(rpp_initialized) {
-        return FAILURE;
-    }
-    rpp_initialized = TRUE;
+       if (rpp_initialized)
+               return FAILURE;
+       rpp_initialized = TRUE;
 
-#if rppCONFIG_DRV == 1
-    dmmInit();
-    gioInit();
-    hetInit();
-    canInit();
-    linInit();
-    spi_tms570_init();
+#ifndef FREERTOS_POSIX
+
+       dmmInit();
+       gioInit();
+       hetInit();
+       rpp_adc_init();
+       rpp_sci_init();
+       rpp_eth_init();
+#if defined(TARGET_TMS570_RPP)
+       linInit();
+       rpp_din_init();
+       rpp_lout_init();
+       rpp_dac_init();
+       rpp_hbr_init();
+       rpp_mout_init();
+       rpp_hout_init();
+       rpp_lin_init();
+       rpp_sdr_init();
+       rpp_irc_init();
+#endif
+       rpp_gio_init(RPP_GIO_PORT_ALL);
+#ifdef TARGET_HAS_SPI
+       rpp_spi_init();
 #endif
+       _enable_IRQ();
 
-    rpp_din_init();
-    rpp_lout_init();
-    rpp_adc_init();
-    rpp_dac_init();
-    rpp_hbr_init();
-    rpp_mout_init();
-    rpp_hout_init();
-    rpp_lin_init();
-    rpp_sci_init();
-#if rppPOSIX_VERSION  == 0
-    rpp_eth_init();
-#endif /* rppPOSIX_VERSION */
-    rpp_sdc_init();
-    rpp_sdr_init();
-    rpp_irc_init();
-#if rppCONFIG_DRV == 1
-    _enable_IRQ();
 #endif
 
-    return SUCCESS;
+       return SUCCESS;
 }