00001 /*@{*//*@}*/ 00010 00011 00012 /******************************************************************************/ 00013 /* Includes (#include) */ 00014 #include <avr/eeprom.h> 00015 00016 /* Own header files */ 00017 #include "xtypes.h" 00018 #include "global.h" 00019 00020 #define EXPORT 00021 #include "memory.h" 00022 #undef EXPORT 00023 00024 /******************************************************************************/ 00025 /* Constants (#define) *//*@{*/ 00026 /* End: Constants (#define) *//*@}*/ 00027 /******************************************************************************/ 00028 00029 /******************************************************************************/ 00030 /* Macro definitions (#define) *//*@{*/ 00031 /* End: Macro definitions (#define) *//*@}*/ 00032 /******************************************************************************/ 00033 00034 /******************************************************************************/ 00035 /* Basic types (typedef) *//*@{*/ 00036 /* End: Basic types (typedef) *//*@}*/ 00037 /******************************************************************************/ 00038 00039 /******************************************************************************/ 00040 /* Local constants (const) *//*@{*/ 00041 /* End: Local constants (const) *//*@}*/ 00042 /******************************************************************************/ 00043 00044 /******************************************************************************/ 00045 /* Local variables *//*@{*/ 00046 00048 STATIC S_MEM_STRUCTRUE mg_sMemory; 00049 00050 /* End: Local variables *//*@}*/ 00051 /******************************************************************************/ 00052 00053 /******************************************************************************/ 00054 /* Global variables *//*@{*/ 00055 /* End: Global variables *//*@}*/ 00056 /******************************************************************************/ 00057 00058 /******************************************************************************/ 00059 /* Prototype declarations */ 00060 STATIC void mg_Load (void); 00061 /* End: Prototype declarations */ 00062 /******************************************************************************/ 00063 00064 /******************************************************************************/ 00065 /* Local functions *//*@{*/ 00066 00067 /* ****************************************************************************/ 00077 /* ****************************************************************************/ 00078 void mg_Load (void) 00079 { 00080 eeprom_read_block(&mg_sMemory, 00081 &(sMemoryEEPROM), 00082 sizeof(S_MEM_STRUCTRUE)); 00083 } 00084 00085 /* End: Local functions *//*@}*/ 00086 /******************************************************************************/ 00087 00088 /******************************************************************************/ 00089 /* Global functions *//*@{*/ 00090 00091 /* ***************************************************************************/ 00101 /* ****************************************************************************/ 00102 void memory_Init (void) 00103 { 00104 mg_Load(); 00105 } 00106 00107 00108 /* ***************************************************************************/ 00119 /* ****************************************************************************/ 00120 CONST S_MEM_STRUCTRUE* memory_Get (void) 00121 { 00122 return (&mg_sMemory); 00123 } 00124 00125 /* End: Global functions *//*@}*/ 00126 /******************************************************************************/ 00127 00128 /**** Last line of code ****/ 00129 00130