EDMA.CR.B.ERCA = ConfigPtr->dmaChannelArbitration;\r
}\r
\r
+void Dma_DeInit( void ) {\r
+ Dma_ChannelType channel;\r
+ for (channel = (Dma_ChannelType)0; channel < DMA_NUMBER_OF_CHANNELS; channel++)\r
+ {\r
+ Dma_StopChannel(channel);\r
+ }\r
+}\r
+\r
+\r
void Dma_ConfigureChannel (Dma_TcdType *tcd, Dma_ChannelType channel)\r
{\r
/* Copy transfer configuration to correct channel. */\r
\r
\r
void Dma_Init (const Dma_ConfigType *ConfigPtr);\r
+void Dma_DeInit (void );\r
void Dma_ConfigureChannel (Dma_TcdType *tcd, Dma_ChannelType channel);\r
void Dma_ConfigureChannelTranferSize (uint32_t nbrOfIterations, Dma_ChannelType channel);\r
void Dma_ConfigureChannelSourceCorr (uint32_t sourceCorrection, Dma_ChannelType channel);\r
#if defined(CFG_MPC5516)\r
static uint32 Mcu_SavedHaltFlags;\r
#else\r
-#error Implement halt flags\r
+static uint32 Mcu_SavedHaltFlags[2];\r
#endif\r
\r
\r
/* Set Recover Vector */\r
#if defined(CFG_MPC5516)\r
\r
-\r
-\r
WRITE32(CRP_Z1VEC, ((uint32)&McuE_LowPowerRecoverFlash) | VLE_VAL );\r
- READWRITE32(CRP_RECPTR,RECPTR_FASTREC,0 );\r
+ READWRITE32( CRP_RECPTR, RECPTR_FASTREC, 0 );\r
\r
Mcu_SavedHaltFlags = SIU.HLT.R;\r
/* Halt everything */\r
\r
WRITE32(CRP_Z6VEC, ((uint32)&McuE_LowPowerRecoverFlash) | VLE_VAL );\r
READWRITE32(CRP_RECPTR,RECPTR_FASTREC,0 );\r
+\r
+ Mcu_SavedHaltFlags[0] = SIU.HLT0.R;\r
+ Mcu_SavedHaltFlags[1] = SIU.HLT1.R;\r
/* Halt everything */\r
SIU.HLT0.R = 0x037FFF3D;\r
SIU.HLT1.R = 0x18000F3C;\r
\r
#if defined(CFG_MPC5516) || defined(CFG_MPC5668)\r
if( MCU_MODE_RUN == mcuMode ) {\r
- /* Get Most back to "normal" halt flags */\r
- SIU.HLT.R = Mcu_SavedHaltFlags;\r
\r
+ /* Get back to "normal" halt flags */\r
+#if defined(CFG_MPC5516)\r
+ SIU.HLT.R = Mcu_SavedHaltFlags;\r
+#elif defined(CFG_MPC5668)\r
+ SIU.HLT0.R = Mcu_SavedHaltFlags[0];\r
+ SIU.HLT1.R = Mcu_SavedHaltFlags[1];\r
+#endif\r
\r
} else if( MCU_MODE_SLEEP == mcuMode ) {\r
/*\r
*\r
*/\r
#if defined(USE_DMA)\r
- Dma_StopAll();\r
+ Dma_DeInit();\r
#endif\r
\r
\r