예제 #1
0
void PduR_ARC_RxIndicationDirect(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {
	Std_ReturnType retVal = PduR_ARC_RouteTransmit(destination, PduInfo);
	if (retVal != E_OK) {
#if defined(USE_DEM)
		Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);
#endif
	}
}
예제 #2
0
/* @req SWS_Fls_00104 */
static void eraseFail( void ) {
	Fls_Global.jobResultType = MEMIF_JOB_FAILED;
	Fls_Global.jobType = FLS_JOB_NONE;
	Fls_Global.status = MEMIF_IDLE;
#if defined(USE_DEM)
	Dem_ReportErrorStatus(DemConf_DemEventParameter_FLS_E_ERASE_FAILED, DEM_EVENT_STATUS_FAILED);
#endif
	FEE_JOB_ERROR_NOTIFICATION();
}
예제 #3
0
파일: Fls.c 프로젝트: uincore/OpenSAR
static void fls_ReadFail( void ) {
	Fls_Global.jobResultType = MEMIF_BLOCK_INCONSISTENT;
	Fls_Global.jobType = FLS_JOB_NONE;
	Fls_Global.status = MEMIF_IDLE;
#if defined(USE_DEM)
	Dem_ReportErrorStatus(FLS_E_READ_FAILED, DEM_EVENT_STATUS_FAILED);
#endif
	FEE_JOB_ERROR_NOTIFICATION();

}
예제 #4
0
파일: Fls.c 프로젝트: uincore/OpenSAR
static void fls_WriteFail( void ) {
	Fls_Global.jobResultType = MEMIF_JOB_FAILED;
	Fls_Global.jobType = FLS_JOB_NONE;
	Fls_Global.status = MEMIF_IDLE;
#if defined(USE_DEM)
	Dem_ReportErrorStatus(FLS_E_WRITE_FAILED, DEM_EVENT_STATUS_FAILED);
#endif
	FEE_JOB_ERROR_NOTIFICATION();

}
예제 #5
0
파일: CanNm.c 프로젝트: paduc77/gainos
Inline void CanNm_Internal_TickTimeoutTime( const CanNm_ChannelType* ChannelConf, CanNm_Internal_ChannelType* ChannelInternal ) {
	if (ChannelConf->MainFunctionPeriod >= ChannelInternal->TimeoutTimeLeft) {
		ChannelInternal->TimeoutTimeLeft = 0;
		if (ChannelInternal->State == NM_STATE_REPEAT_MESSAGE) {
#if defined(USE_DEM)
			Dem_ReportErrorStatus(CANNM_E_NETWORK_TIMEOUT, DEM_EVENT_STATUS_FAILED);
#endif
			CanNm_Internal_RepeatMessage_to_RepeatMessage(ChannelConf, ChannelInternal);  /**< @req CANNM101.1 */
		} else if (ChannelInternal->State == NM_STATE_NORMAL_OPERATION) {
#if defined(USE_DEM)
			Dem_ReportErrorStatus(CANNM_E_NETWORK_TIMEOUT, DEM_EVENT_STATUS_FAILED);
#endif
			CanNm_Internal_NormalOperation_to_NormalOperation(ChannelConf, ChannelInternal);  /**< @req CANNM117.1 */
		} else if (ChannelInternal->State == NM_STATE_READY_SLEEP) {
			CanNm_Internal_ReadySleep_to_PrepareBusSleep(ChannelConf, ChannelInternal);  /**< @req CANNM109 */
		} else {
			//Nothing to be done
		}
	} else {
		ChannelInternal->TimeoutTimeLeft -= ChannelConf->MainFunctionPeriod;
	}
}
예제 #6
0
파일: Mcu.c 프로젝트: t8534/acore_repo
void Mcu_LossOfLock( void  ){
#if defined(USE_DEM)
	Dem_ReportErrorStatus(MCU_E_CLOCK_FAILURE, DEM_EVENT_STATUS_FAILED);
#endif

  /*
   * NOTE!!!
   * This interrupt may be triggered more than expected.
   * If you are going to use this interrupt, see [Freescale Device Errata MPC5510ACE, Rev. 10 APR 2009, errata ID: 6764].
   *
   */
#if defined(CFG_MPC560X)
	/*not support*/
#else
	Mcu_Global.stats.lossOfLockCnt++;
	// Clear interrupt
	FMPLL.SYNSR.B.LOLF = 1;
#endif
}
예제 #7
0
파일: EcuM.c 프로젝트: t8534/acore_repo
/**
 * Kill all RUN requests and perform shutdown without waiting for application
 * to finish
 *
 * Note that for 4.x this should NOT kill POST_RUN requests
 *
 */
void EcuM_KillAllRUNRequests(void) {
	/* @req 3.1.5/ECUM2821 */

	EcuM_World.killAllRequest = true;

	/* @req 3.1.5|4.0.3/ECUM2668 */
	/* @req 3.1.5/ECUM1872 */
	EcuM_World.run_requests = 0;
	EcuM_World.postrun_requests = 0;
#if defined(USE_COMM)
	EcuM_World.run_comm_requests = 0;
#endif


#if defined(USE_DEM)
    Dem_ReportErrorStatus(ECUM_E_ALL_RUN_REQUESTS_KILLED, DEM_EVENT_STATUS_FAILED );
#endif

}
예제 #8
0
void PduR_ARC_RxIndicationTT(const PduRDestPdu_type * destination, const PduInfoType *PduInfo, uint16 BufferLength) {
	Std_ReturnType retVal = E_OK;

	uint16 bytesToCopy = 0;
	if (PduInfo->SduLength > BufferLength){ bytesToCopy = BufferLength;}
	else {bytesToCopy = PduInfo->SduLength;}

	if (!memcpy(destination->TxBufferRef, PduInfo->SduDataPtr, bytesToCopy)){ retVal |= E_NOT_OK;}
	retVal |= PduR_ARC_RouteTransmit(destination, PduInfo);

	if (retVal != E_OK) {
#if defined(USE_DEM)
		Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);
#endif
	}
	/*
	// This is a gateway request which uses trigger transmit data provision. PDUR255
	if (destination->TxBufferRef->TxConfP) { // Transfer confirmation pending.
		// Enqueue the new I-PDU. This will flush the buffer if it is full according to the buffer specification.
		PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);
		// TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed.
	}

	if (destination->TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore).
		uint8 val[PduInfo->SduLength];
		PduInfoType NewPduInfo = {
			.SduDataPtr = val,
			.SduLength = PduInfo->SduLength
		};
		PduR_BufferDeQueue(destination->TxBufferRef, val);
		PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);
		retVal = PduR_ARC_RouteTransmit(destination, &NewPduInfo);
		if (retVal == E_OK) {
			setTxConfP(destination->TxBufferRef);
		}
	}
	*/
}
예제 #9
0
void RamTst_RunFullTest( void )
{
	/* @req SWS_RamTst_00089 */
	VALIDATE( ( RamTst_Internal.InitStatus != RAMTST_UNINIT ), RAMTST_INIT_SERVICE_ID, RAMTST_E_UNINIT);
	/* @req SWS_RamTst_00170 */
	VALIDATE( ( (RAMTST_EXECUTION_STOPPED) == RamTst_Internal.ExecStatus ), RAMTST_RUNFULLTEST_SERVICE_ID, RAMTST_E_STATUS_FAILURE);
	const RamTst_AlgParamsType *algParams = NULL;

	/* Find config for the active algorithm */
	for(RamTst_AlgParamsIdType i = 0; (i < RamTst_ConfigParams.RamTstNumberOfAlgParamSets) && (NULL == algParams); i++) {
	    if( RamTst_ConfigParams.RamTstAlgParams[i].RamTstAlgParamsId == RamTst_Internal.ActiveAlgParamID ) {
	        algParams = &RamTst_ConfigParams.RamTstAlgParams[i];
	    }
	}
    if( NULL != algParams ) {
        /* @req SWS_RamTst_00169 */
        RamTst_Internal.ExecStatus = RAMTST_EXECUTION_RUNNING;

        RamTst_Internal.CurrentTestResult = RAMTST_RESULT_UNDEFINED;

        /* @req SWS_RamTst_00196 */

        /* Run for all blocks */
        for(RamTst_NumberOfBlocksType i = 0; i<algParams->RamTstNumberOfBlocks;i++)
        {
            RamTst_Internal.RamTst_BlockResultBuffer[algParams->RamTstBlockParams[i].RamTstBlockIndex] = RAMTST_RESULT_NOT_TESTED;
        }
        for(RamTst_NumberOfBlocksType i = 0; i < algParams->RamTstNumberOfBlocks; i++)
        {
            RamTst_TestResultType res;
    #ifdef HOST_TEST
            if( algParams->RamTstBlockParams[i].RamTstBlockId == induceErrorBlockId ) {
                induceerror_flag = 1;
            }
    #endif
            switch(algParams->RamTstAlgorithm)
            {
    #if (RAMTST_MARCH_TEST_SELECTED == STD_ON)
            case RAMTST_MARCH_TEST:
                res = ramTstMarchX(algParams->RamTstBlockParams[i].RamTstStartAddress, algParams->RamTstBlockParams[i].RamTstEndAddress);
                break;
    #endif
            default:// not implemented yet
                res = RAMTST_RESULT_NOT_OK;
                break;
            }
            /* @req SWS_RamTst_00212 */
            /* @req SWS_RamTst_00213 */
            if(res != RAMTST_RESULT_OK){
    #if defined(USE_DEM)
                if(DEM_EVENT_ID_NULL != RamTst_ConfigParams.RAMTST_E_RAM_FAILURE) {
                    (void)Dem_ReportErrorStatus(RamTst_ConfigParams.RAMTST_E_RAM_FAILURE, DEM_EVENT_STATUS_FAILED);
                }
    #endif
                RamTst_Internal.CurrentTestResult = RAMTST_RESULT_NOT_OK;
            }
            RamTst_Internal.RamTst_BlockResultBuffer[algParams->RamTstBlockParams[i].RamTstBlockIndex] = res;
    #ifdef HOST_TEST
            induceerror_flag = 0;
    #endif
        }
        if( RAMTST_RESULT_UNDEFINED == RamTst_Internal.CurrentTestResult ) {
            RamTst_Internal.CurrentTestResult = RAMTST_RESULT_OK;
        }
            /* @req SWS_RamTst_00211 */
        RamTst_Internal.ExecStatus = RAMTST_EXECUTION_STOPPED;
	}
#ifdef HOST_TEST
    induceErrorBlockId = 0;
#endif
}
예제 #10
0
파일: CanSM.c 프로젝트: digideskio/moped
CanSM_Internal_FullCommExitPointType CanSm_Internal_BSM_S_FULLCOM( NetworkHandleType NetworkHandle )
{
	/* Sub state machine for requested full communication requirements
	 *

	 * !req:CHANGEBAUDRATE CANSM507
	 * !req:CHANGEBAUDRATE CANSM528
	 *  */
	CanSM_Internal_FullCommExitPointType exitPoint = CANSM_FULLCOMM_EXITPOINT_NONE;
	CanSM_Internal_NetworkType *Network = &CanSM_Internal.Networks[NetworkHandle];
	const CanSM_NetworkType *NetworkCfg = &CanSM_Config->Networks[NetworkHandle];

	switch(Network->FullCommState)
	{
	case CANSM_FULLCOMM_S_BUSOFF_CHECK:
		Network->subStateTimer++;
		if( Network->busoffevent ) {
			Network->busoffevent = FALSE;
			if( Network->busoffCounter < NetworkCfg->CanSMBorCounterL1ToL2 ) {
				Network->busoffCounter++;
			}
			/* @req CANSM500 */
#if defined(USE_BSWM)
			/* @req CANSM508*/
			BswM_CanSM_CurrentState(NetworkCfg->ComMNetworkHandle, CANSM_BSWM_BUS_OFF);
#endif
			/* @req CANSM521 */
			CanSM_Internal_ComM_BusSM_ModeIndication(NetworkHandle, COMM_SILENT_COMMUNICATION);

#if defined(USE_DEM)
			/* @req CANSM522 */
			if( DEM_EVENT_ID_NULL != NetworkCfg->CanSMDemEventId ) {
				DEM_REPORT_ERROR_STATUS(NetworkCfg->CanSMDemEventId, DEM_EVENT_STATUS_PREFAILED);
			}
#endif

			Network->RepeatCounter = 0;
			Network->FullCommState = CANSM_FULLCOMM_S_RESTART_CC;
			break;
		} else if( Network->subStateTimer >= NetworkCfg->CanSMBorTimeTxEnsured ) {
			/* @req CANSM496 */
			/* !req:TXCONFIRMPOLLING CANSM497 */

#if defined(USE_DEM)
			/* @req CANSM498 */
			if( DEM_EVENT_ID_NULL != NetworkCfg->CanSMDemEventId ) {
				DEM_REPORT_ERROR_STATUS(NetworkCfg->CanSMDemEventId, DEM_EVENT_STATUS_PASSED);
			}
#endif
			Network->busoffCounter = 0;
			Network->FullCommState = CANSM_FULLCOMM_S_NO_BUSOFF;
		} else
			break;
	//lint -fallthrough
	case CANSM_FULLCOMM_S_NO_BUSOFF:
		if( Network->busoffevent ) {
			Network->busoffevent = FALSE;
			if( Network->busoffCounter < NetworkCfg->CanSMBorCounterL1ToL2 ) {
				Network->busoffCounter++;
			}

			/* @req CANSM500 */
#if defined(USE_BSWM)
			/* @req CANSM508 */
			BswM_CanSM_CurrentState(NetworkCfg->ComMNetworkHandle, CANSM_BSWM_BUS_OFF);
#endif
            /* @req CANSM521 */
			CanSM_Internal_ComM_BusSM_ModeIndication(NetworkHandle, COMM_SILENT_COMMUNICATION);
#if defined(USE_DEM)
			/* @req CANSM522 */
			if( DEM_EVENT_ID_NULL != NetworkCfg->CanSMDemEventId ) {
				Dem_ReportErrorStatus(NetworkCfg->CanSMDemEventId, DEM_EVENT_STATUS_PREFAILED);
			}
#endif

			Network->RepeatCounter = 0;
			Network->FullCommState = CANSM_FULLCOMM_S_RESTART_CC;
		} else if( (COMM_SILENT_COMMUNICATION == Network->requestedMode) ||
				( COMM_NO_COMMUNICATION == Network->requestedMode ) ) {
			/* @req CANSM499 */
			/* @req CANSM554 */
			exitPoint = CANSM_FULLCOMM_EXITPOINT_SILENTCOMM;
		}
		break;
	case CANSM_FULLCOMM_S_RESTART_CC:
	{
		if( Network->RepeatCounter <= CanSM_Config->CanSMModeRequestRepetitionMax ) {
			Network->RepeatCounter++;
			/* @req CANSM509 */
			if( E_OK == CanSM_Internal_SetNetworkControllerMode(NetworkHandle, CANIF_CS_STARTED) ) {
				if( E_OK == CanSM_Internal_GetNetworkControllerModeIndicated(NetworkHandle) ) {
					/* @req CANSM511 */
					/* @req CANSM513 */
					CanSM_Internal_SetNetworkPduMode(NetworkHandle, CANIF_SET_TX_OFFLINE);
					Network->FullCommState = CANSM_FULLCOMM_S_TX_OFF;
				} else {
					/* @req CANSM510 */
					Network->FullCommState = CANSM_FULLCOMM_S_RESTART_CC_WAIT;
				}
				Network->subStateTimer = 0;
			}
		} else {
			/* @req CANSM523 */
			/* @req CANSM385 */
			CANSM_DET_REPORTERROR(CANSM_SERVICEID_MAINFUNCTION, CANSM_E_MODE_REQUEST_TIMEOUT);
			exitPoint = CANSM_FULLCOMM_EXITPOINT_PRENOCOMM;
		}
		break;
	}
	case CANSM_FULLCOMM_S_RESTART_CC_WAIT:
		Network->subStateTimer++;
		if( E_OK == CanSM_Internal_GetNetworkControllerModeIndicated(NetworkHandle)) {
			/* @req CANSM511 */
			/* @req CANSM513 */
			CanSM_Internal_SetNetworkPduMode(NetworkHandle, CANIF_SET_TX_OFFLINE);
			Network->subStateTimer = 0;
			Network->FullCommState = CANSM_FULLCOMM_S_TX_OFF;
		} else if( Network->subStateTimer >= CanSM_Config->CanSMModeRequestRepetitionTime ) {
			/* @req CANSM512 */
			Network->FullCommState = CANSM_FULLCOMM_S_RESTART_CC;
		}
		break;
	case CANSM_FULLCOMM_S_TX_OFF:
		/* @req CANSM514 */
		/* @req CANSM515 */
		Network->subStateTimer++;
		if( ((Network->subStateTimer >= NetworkCfg->CanSMBorTimeL1) &&
				(Network->busoffCounter < NetworkCfg->CanSMBorCounterL1ToL2)) ||
				((Network->subStateTimer >= NetworkCfg->CanSMBorTimeL2) &&
				(Network->busoffCounter >= NetworkCfg->CanSMBorCounterL1ToL2))) {
#if defined(USE_CANSM_EXTENSION)
		    CanSM_Extension_WriteState(NetworkHandle, Network->busoffCounter, Network->subStateTimer, NetworkCfg);
#endif
			/* @req CANSM516 */
			CanSM_Internal_SetNetworkPduMode(NetworkHandle, CANIF_SET_ONLINE);
#if defined(USE_BSWM)
			/* @req CANSM517*/
			BswM_CanSM_CurrentState(NetworkCfg->ComMNetworkHandle, CANSM_BSWM_FULL_COMMUNICATION);
#endif
			/* @req CANSM518 */
			CanSM_Internal_ComM_BusSM_ModeIndication(NetworkHandle, COMM_FULL_COMMUNICATION);
			Network->FullCommState = CANSM_FULLCOMM_S_BUSOFF_CHECK;
			Network->subStateTimer = 0;
		}
		break;
	default:
		break;
	}

	return exitPoint;
}