]> rtime.felk.cvut.cz Git - arc.git/commitdiff
EcuM fixes...
authormahi <devnull@localhost>
Thu, 22 Mar 2012 14:34:49 +0000 (15:34 +0100)
committermahi <devnull@localhost>
Thu, 22 Mar 2012 14:34:49 +0000 (15:34 +0100)
arch/ppc/mpc55xx/scripts/linkscript_diab.ldf
boards/generic/EcuM_Generated_Types.h
include/CanIf.h
include/CanSM.h
include/CanSM_EcuM.h
include/EcuM.h
include/EcuM_Cbk.h
include/EcuM_Types.h
system/EcuM/EcuM.c
system/EcuM/EcuM_Main.c
system/EcuM/EcuM_ServicePort.c

index 8b88ada894795375cecd57d076bdde0356f5f0d4..ac442182d52c261fdc6515337d1461ee8ecfe0ba 100644 (file)
@@ -1,3 +1,4 @@
+
 MEMORY
 {
        #include "memory.ldf"
@@ -59,6 +60,8 @@ SECTIONS
                .ramlog (DATA) : { *(.ramlog) }
                /* Any remaining space will be used as a heap.              */
 
+               .calibration : {}  
+
                /* TODO: Flash driver in RAM */
                FLASHDRV (DATA) : { 
                .=.+0x1000;
index 577213e9b4b7aa4ab2849fce37c51f3f4151b83a..b9e0417ffa90e59776687fe24c3e5e21c6257557 100644 (file)
@@ -85,7 +85,7 @@
 #include "LinSM.h"
 #endif\r
 \r
-typedef struct\r
+typedef struct EcuM_Config\r
 {\r
        EcuM_StateType EcuMDefaultShutdownTarget;\r
        uint8 EcuMDefaultSleepMode;\r
index 8355ba303f24c951b851466de21333507456cd37..d415b307e87bf2c2efed7961ce72f6502d889893 100644 (file)
@@ -15,7 +15,7 @@
 \r
 \r
 \r
-\r
+#error NOOOOOOOOOOOOOOOOOOO\r
 \r
 \r
 \r
index 9a42658906846c4d47b97147c8bdcf0878d617e8..ddc03ed402a2f1ecf4cdf54e81386df15fef8d6a 100644 (file)
@@ -72,9 +72,6 @@ typedef enum {
 \r
 /** @req CANSM037 */\r
 \r
-/** This service initializes the CanSM module */\r
-/** @req CANSM023 */\r
-void CanSM_Init( const CanSM_ConfigType* ConfigPtr );\r
 \r
 /** This service puts out the version information of this module */\r
 /** @req CANSM024  @req CANSM180 */\r
index b386569b6e5dac61c63c02b4491f3ae0c335f85f..18eb5b37c73b764b413b5904a97de9e9bac0ce24 100644 (file)
 #ifndef CANSM_ECUM_H_\r
 #define CANSM_ECUM_H_\r
 \r
+#include "CanSM.h"\r
+\r
+/** This service initializes the CanSM module */\r
+/** @req CANSM023 */\r
+void CanSM_Init( const CanSM_ConfigType* ConfigPtr );\r
 \r
 #endif /* CANSM_ECUM_H_ */\r
index b5747be8728720ef00212d127eeee1bb922281dd..39ce8d52a8ef217c271fe34148d966cc3d657e1c 100644 (file)
  * API and type definitions for ECU State Manager.\r
  */\r
 \r
+/*\r
+ * Include structure:\r
+ *\r
+ *\r
+ *\r
+ *   Rte_Type.h -->  Std_Types.h\r
+ *       ^              ^\r
+ *       |              |\r
+ *   Rte_EcuM.h <--  EcuM_Types.h*\r
+ *       ^              ^\r
+ *       |              |    /-----> EcuM_Cfg.h\r
+ *       |              |   /------> EcuM_Generated_Types.h\r
+ *       |              |  /-------> EcuM_Cbk.h\r
+ *       |              | /\r
+ *       |              |/\r
+ *       |            EcuM.h  <----- EcuM_Callout_Stubs.c\r
+ *       |              ^       \--- EcuM_PBCfg.c\r
+ *       |              |\r
+ *       |              |\r
+ *       `---------- EcuM_xxx.c ---> Memmap.h\r
+ *                               \-> Det.h, Dem.h\r
+ *\r
+ * *) Only if (ECUM_USE_SERVICE_PORTS == STD_ON)\r
+ *\r
+ * Problems:\r
+ * - Can_Cfg.h can include just "EcuM_Cbk.h"...\r
+ *   .. it will need at EcuM.h.. problem is that EcuM.h includes EcuM_Cbk.h\r
+ * - Most BSW modules uses DEM that in Dem_Types.h will include "Rte_Type.h"\r
+ *   (if enabled by CFG_DEM_USE_RTE)\r
+ *\r
+ * - EcuM_Generated_Types.h is quite crappy since it includes the\r
+ *\r
+ *\r
+ */\r
+\r
+\r
 #ifndef ECUM_H_\r
 #define ECUM_H_\r
 \r
 #define ECUM_AR_MINOR_VERSION  2\r
 #define ECUM_AR_PATCH_VERSION  2\r
 \r
+struct EcuM_Config;\r
+typedef struct EcuM_Config EcuM_ConfigType;\r
+\r
+/* Holds EcuM_ConfigType */\r
+/* TODO: forward declare all config types here ? */\r
+/* TODO: EcuM_Generated_Types must have types from Ecu_Types.h */\r
+#include "EcuM_Types.h"\r
+#include "EcuM_Generated_Types.h"\r
 #include "EcuM_Cfg.h"\r
+#include "EcuM_Cbk.h"\r
 \r
 #if defined(USE_COM)\r
 #include "ComStack_Types.h"\r
 #endif\r
-#if (ECUM_USE_SERVICE_PORTS == STD_ON) && defined(USE_RTE)\r
-#include "Rte_Type.h"\r
-#endif\r
 \r
-#include "EcuM_Types.h"\r
 \r
 \r
 /** @name Error Codes */\r
 #define ECUM_AR_MINOR_VERSION  2\r
 #define ECUM_AR_PATCH_VERSION  2\r
 \r
-#include "EcuM_Cfg.h"\r
-\r
 #if ( ECUM_VERSION_INFO_API == STD_ON)\r
 #define EcuM_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,ECUM)\r
 #endif\r
index edd44908633a597e06ed693ec1fd1077006f3979..d4f7e8b03d2be435f6949c37eef08fd60abe5d39 100644 (file)
  * for more details.\r
  * -------------------------------- Arctic Core ------------------------------*/\r
 \r
+/*\r
+ * Callback used by\r
+ *\r
+ *\r
+ */\r
 \r
 \r
+#ifndef ECUM_CBK_H_\r
+#define ECUM_CBK_H_\r
 \r
 \r
+#include "EcuM.h"\r
 \r
+#if !defined(_ECUM_GENERATED_TYPES_H_)\r
+#error NOOOOOOO\r
+#endif\r
 \r
 \r
-#ifndef ECUM_CBK_H_\r
-#define ECUM_CBK_H_\r
-\r
-#include "EcuM.h"\r
+//#if !defined(I_HAVE_DEFINED)\r
+//#error NOOOOOOO2\r
+//#endif\r
 \r
 //void EcuM_CB_NfyNvMJobEnd(uint8 ServiceId, NvM_RequestResultType JobResult);\r
 \r
index c1819183d7c0d0bcc5737c765886ce374a1f8cce..ca2616dc107810a5248afd6bd1bfc64f813acce4 100644 (file)
 #include "Std_Types.h"\r
 #include <Os.h>\r
 \r
+#if defined(RTE_TYPE_H) && defined(__GNUC__)\r
+//#warning RTE_TYPE included before EcuM_Types.h\r
+#endif\r
+\r
+#if (ECUM_USE_SERVICE_PORTS == STD_ON)\r
+#include "Rte_Type.h"\r
+#endif\r
+\r
 #if !defined(_DEFINED_TYPEDEF_FOR_EcuM_StateType_)\r
 /** Possible states */\r
 typedef enum {\r
index 8fb5ecdacdf09d0cc56344f2464a5e7c48b7cf84..6e517b5cfb30afd720c178b20da328f7255b5190 100644 (file)
 #if defined(USE_RTE)\r
 #include "Rte_Main.h"\r
 #endif\r
+#if defined(USE_SCHM)\r
+#include "SchM.h"\r
+#endif\r
+\r
+\r
 \r
 EcuM_GlobalType internal_data;\r
 \r
@@ -114,7 +119,9 @@ void EcuM_StartupTwo(void)
 #endif\r
 \r
        // Initialize the BSW scheduler\r
-       // TODO SchM_Init();\r
+#if defined(USE_SCHM)\r
+       SchM_Init();\r
+#endif\r
 \r
        // Initialize drivers that don't need NVRAM data\r
        EcuM_AL_DriverInitTwo(internal_data.config);\r
index 1fd4360b0b1fb646fda8759cf1c91bbe6953e66f..d7bc05ef282860708b1caf80006e6a445f2ea349 100644 (file)
 \r
 //lint -emacro(904,VALIDATE,VALIDATE_RV,VALIDATE_NO_RV) //904 PC-Lint exception to MISRA 14.7 (validate macros).\r
 \r
+#if (ECUM_USE_SERVICE_PORTS==STD_ON)\r
+/* Rte_EcuM.h will include Rte_Type.h */\r
+#include "Rte_EcuM.h"\r
+#endif\r
 #include "EcuM.h"\r
-#include "EcuM_Cbk.h"\r
 #include "EcuM_Internals.h"\r
+\r
 #if defined(USE_DEM)\r
 #include "Dem.h"\r
 #endif\r
index 9ed6fe1f3f9723c0b28fb6a5d49cadae118885de..72004e9a7bba1f7d7b9ba6507a8ea1b8dd1b10aa 100644 (file)
  * for more details.\r
  * -------------------------------- Arctic Core ------------------------------*/\r
 \r
+#if 0\r
+#include "Rte_EcuM.h"\r
+#else\r
 #include "EcuM.h"\r
+#include "EcuM_Internals.h"\r
+#endif\r
 \r
 Std_ReturnType EcuM_ShutdownTarget_GetLastShutdownTarget(EcuM_StateType* target, UInt8* mode) {\r
        return E_NOT_OK;\r