void EcuM_AL_Reset(EcuM_ResetType reset)
{
	// IMPROVEMENT: Perform reset based on the reset parameter
#if (MCU_PERFORM_RESET_API == STD_ON)
	Mcu_PerformReset();
#else
	for(;;)
	{
		;
	}
#endif
}
/**
 * This function should be the last this called before reset.
 * Normally this manipulates some pin that controls DC to power off
 * the board (ie it will never get to Mcu_PerformReset())
 */
void EcuM_AL_SwitchOff(void)
{

	/* ADD CODE BELOW */
#if 0
	/* Example */
	Dio_WriteChannel(DIO_CHANNEL_NAME_MY_POWER,STD_LOW);
#endif

#if defined(USE_MCU) && (MCU_PERFORM_RESET_API == STD_ON)
	Mcu_PerformReset();
#endif
}
/**
 * Called if there is something very wrong.
 *
 * Checks for ECUM_E_RAM_CHECK_FAILED (bad hash at wakeup) or
 * ECUM_E_CONFIGURATION_DATA_INCONSISTENT (bad post-build data)
 *
 * This function should NEVER return
 *
 * @param reason
 */
void EcuM_ErrorHook(Std_ReturnType reason) {
	/* @req 4.0.3|3.1.5/EcuM2904  */

	/* Go to defined state Reset, Fail-Safe etc. */

#if (MCU_PERFORM_RESET_API == STD_ON)
	Mcu_PerformReset();
#else
	assert(0);
#endif

#if defined(USE_DET)
#endif
}
Esempio n. 4
0
// Typically called from OS shutdown hook
void EcuM_Shutdown(void) {
	set_current_state(ECUM_STATE_GO_OFF_TWO);

	// Let the last drivers do a nice shutdown
	EcuM_OnGoOffTwo();

	if (EcuM_World.shutdown_target == ECUM_STATE_OFF) {
		EcuM_AL_SwitchOff();
	} else {
#if (MCU_PERFORM_RESET_API == STD_ON)
		Mcu_PerformReset();
#else
		for(;;)
		{
			;
		}
#endif
	}
}