SIU.HLT.R = 0x3FFFFFFF;\r
while((SIU.HLTACK.R != 0x3FFFFFFF) && (timeout++<3000)) {}\r
\r
- /* put Z0 in reset if not used for wakeup */\r
- CRP.Z0VEC.B.Z0RST = 1;\r
-\r
#elif defined(CFG_MPC5668)\r
\r
WRITE32(CRP_Z6VEC, ((uint32)&McuE_LowPowerRecoverFlash) | VLE_VAL );\r
mtspr SPR_MAS0,r5 \r
LOAD_ADDR_32(5, (0xC0000000 + MAS1_TSIZE_256K) )\r
mtspr SPR_MAS1,r5 \r
- LOAD_ADDR_32(5, (SRAM_START + VLE_VAL))\r
+ LOAD_ADDR_32(5, (SRAM_START + VLE_VAL + MAS2_I))\r
mtspr SPR_MAS2,r5 \r
LOAD_ADDR_32(5, (SRAM_START + MAS3_FULL_ACCESS))\r
mtspr SPR_MAS3,r5\r
assert(((uint32)exception_tbl & 0xfff)==0);\r
set_spr(SPR_IVPR,(uint32)exception_tbl);\r
\r
- ramlog_str("Test\n");\r
- ramlog_hex(0x10);\r
- ramlog_dec(20);\r
-\r
// TODO: The 5516 simulator still thinks it's a 5554 so setup the rest\r
#if (defined(CFG_SIMULATOR) && defined(CFG_MPC5516)) || defined(CFG_MPC5567) || defined(CFG_MPC5554) || defined(CFG_MPC5668)\r
set_spr(SPR_IVOR0,((uint32_t)&exception_tbl+0x0) );\r
\r
case ECUM_STATE_GO_SLEEP:\r
in_state_goSleep();\r
- break;\r
+ /* Flow Through, Scheduler is Locked */\r
\r
case ECUM_STATE_SLEEP:\r
in_state_sleep();\r
- /* Flow Through */\r
+ /* Flow Through, Scheduler is Locked */\r
\r
case ECUM_STATE_WAKEUP_ONE: {\r
DEBUG_ECUM_STATE(internal_data.current_state);\r
//internal_data.validationTimer = validationMaxTime;\r
} else {\r
LDEBUG_PRINTF("No Validation for event:0x%lx\n",(uint32)wkupCfgPtr->EcuMWakeupSourceId);\r
+\r
+ /* Validate right away */\r
EcuM_ValidateWakeupEvent(wkupCfgPtr->EcuMWakeupSourceId);\r
}\r
}\r
uint32 pendingWkupMask;\r
\r
if( validationMask == 0 ) {\r
+ pendingWkupMask = EcuM_GetPendingWakeupEvents();\r
// TODO: We can skip callout's here?\r
\r
// TODO:\r
// ComM_EcuM_WakeupIndication( network handle )\r
\r
+ DEBUG_ECUM_CALLOUT_W_ARG("EcuM_StartWakeupSources","0x%lx",(uint32)pendingWkupMask);\r
+ EcuM_StartWakeupSources(pendingWkupMask);\r
set_current_state(ECUM_STATE_WAKEUP_REACTION);\r
\r
} else {\r
\r
if( pendingWkupMask == validationMask ) {\r
/* Match beetween the events that need validation -> done validating */\r
- set_current_state(ECUM_STATE_WAKEUP_REACTION);\r
DEBUG_ECUM_CALLOUT_W_ARG("EcuM_StartWakeupSources","0x%lx",(uint32)wMask);\r
EcuM_StartWakeupSources(wMask);\r
+ set_current_state(ECUM_STATE_WAKEUP_REACTION);\r
} else {\r
if (internal_data.validationTimer == 0) {\r
// EcuM_StopWakeupSources(0); // TODO\r