AUTOSAR EcuM模块代码记录
一、EcuM_Init
Initializes the ECU state manager and carries out the startup one procedure ,which is done before the OS is started.At the end of this service OS is started and the contol is handed over to OS.
1、设置EcuM状态 ECUM_PRV_PHASE_START_PREOS
2、 DriverInitZero
DriverInitOne
3、检查唤醒源EcuM_SetWakeupEvent
4、StartOS
二、EcuM_StartupTwo
The integrator can configure the OS to activate the EcuM_StartupTwo task by any mechanism, as long as it
is started immediately after StartOS is called. The task can also be activated from within another task and this
other task could be an autostart task.
1、设置EcuM状态 ECUM_PRV_PHASE_START_POSTOS
2、初始化SchM SchM_Init
3、初始化BswM BswM_Init
三、EcuM_MainFunction
EcuM sheduled functions which is called by the BSW sheduler in a cyclic interval defined by the configuration parameter EcuM_MainFunctionPeriod.Carries out all the functionality of the EcuM when the OS is running.
1、检查下电标记
下电标记激活:
2、EcuM_OnGoOffOne
3、BswM_Deinit
4、SchM_Deinit
5、ShutdownOS
下电标记未激活:
6、设置EcuM状态 ECUM_PRV_PHASE_UP
7、校验唤醒源
ECUM_WKSTATUS_NONE
ECUM_WKSTATUS_PENDING
ECUM_WKSTATUS_VALIDATED
ECUM_WKSTATUS_EXPIRED
8、通知BswM BswM_EcuM_CurrentWakeup
9、仲裁用户RUN请求/释放
10、向BswM请求进入RUN状态 BswM_EcuM_RequestedState
11、仲裁用户POST RUN请求/释放
12、向BswM请求进入POSTRUN状态 BswM_EcuM_RequestedState
四、EcuM_RequestRUN
Places a request for the RUN state. Requests can be placed by every user made known to the state manager at configuration time.
1、校验用户
2、存储用户RUN请求
五、EcuM_RequestPOST_RUN
Places a request for the POST_RUN state. Requests can be placed by every user made known to the state manager at configuration time.
1、校验用户
2、存储用户POSTRUN请求
六、EcuM_ReleaseRUN
Releases a RUN request previously done with a call to EcuM_RequestRUN.
1、校验用户
2、存储用户POSTRUN请求
七、EcuM_ReleasePOST_RUN
Releases a Post_RUN request previously done with a call to EcuM_RequestPost_RUN.
1、校验用户
2、存储用户POSTRUN请求
八、 EcuM_KillAllRUNRequests
This function unconditionally releases all pending requests to RUN.
九、EcuM_KillAllPostRUNRequests
This function unconditionally releases all pending requests to PostRUN.
十、EcuM_SetState
function called by BswM to notify about State Switch.(BswM_Prv_Action_EcuMStateSwitch)
通知RTE中ECUM的状态
ECUM_STATE_STARTUP
ECUM_STATE_APP_RUN
ECUM_STATE_APP_POST_RUN
ECUM_STATE_SHUTDOWN
ECUM_STATE_SLEEP
流程:
EcuM_Init->StartupOne->Start_task->StartupTwo->UP
user->EcuM_RequestRUN->EcuM_MainFunction->BswM_EcuM_RequestedState(RUN)->BswM_Prv_Action_EcuMStateSwitch->EcuM_SetState(ECUM_STATE_APP_RUN)->RTE
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
