//***************************************************************************** // (C) Automotive Lighting Reutlingen GmbH // Tuebinger Strasse 123, 72762 Reutlingen, Germany // // Automotive Lighting Reutlingen GmbH owns all the rights to this work. // This work shall not be copied, reproduced, used, modified, transferred // or its information shall not be disclosed without the prior written // authorization of Automotive Lighting Reutlingen GmbH. //***************************************************************************** //----------------------------------------------------------------------------- /// \file CddStp_Simulation.c /// /// \brief Simulation interface used for HIL test /// /// \author J. Kling ALRT-EES6 (f84304b) /// //----------------------------------------------------------------------------- //============================================================================= // Standard / system header file includes //============================================================================= #include #include //-- STATIC_AL //============================================================================= // Project-specific header file includes //============================================================================= #ifndef UNIT_TEST // NOT Unit-Tests = 'regular' #include #else // Unit-Tests! #define CFA_CNT_STP_88XX (4u) //#include <../../Cust/Bw/Bw16/App/Bsw/Cdd/CddStp/CddStpPrj.h> #include #endif #ifdef CDDSTP_CFG_SIMULATION // defined in '.\Asr6\Src\Src_AL\Cust\Bw\Bw16\App\Bsw\Cdd\CddStp\CddStpPrj.h' #include //============================================================================= // local variables //============================================================================= STATIC_AL volatile tCddStp_Simulation_Data CddStp_Simulation_Data = // simulation for validation purposes { .ulSimActivated = CDDSTP_SIMULATION_DEACTIVATED, // simulation active (password '0xC0DE1234u' <-> '0xDEADC0DEu') .unVBatt_EcuSupply_mV = CDDSTP_SIMULATION_UNUSED_VALUE, // 'Magic-Number' -> Simu-Voltage NOT valid/used .ucSim_DriverDefect = eSimuHandling_Inactive, .ucSim_SPI_ERROR_SpiProtocolError = eSimuHandling_Inactive, .unSim_SPI_ERROR_SpiProtocolErrCnt = 0u, .ucSim_UVLO_UnderVoltageLockout = eSimuHandling_Inactive, .ucSim_CPUV_ChargePumpUndervoltage = eSimuHandling_Inactive, .ucSim_OCP_OverCurrentProtection = eSimuHandling_Inactive, .ucSim_OL_OpenLoad = eSimuHandling_Inactive, //.ucSim_TF_ThermalFault = eSimuHandling_Inactive, .ucSim_OTW_OverThermalWarning = eSimuHandling_Inactive, .ucSim_OTS_OverTemperatureShutdown = eSimuHandling_Inactive, .ucSim_UTW_UnderTemperatureWarning = eSimuHandling_Inactive, .ucSim_LT_IsLowTemperature = eSimuHandling_Inactive, .ucSim_StReg_Basic = 0u, .ucSim_StReg_Fault = 0u, .ucSim_StReg_DiagStatus1 = 0u, .ucSim_StReg_DiagStatus2 = 0u, // Pre-Evaluation Stall-Detection .bStallDtctn_ReadCodingOnce = FALSE, .codingParams = { .ucStallDtctn_Haltestrom = 11, // 'CddStp_tCodingAreaLwr.Strom.ucHaltNT' - 3x the same: TT, NT, HT .ucStallDtctn_Fahrstrom = 56, // 'CddStp_tCodingAreaLwr.Strom.ucFahrNT' - 3x the same: TT, NT, HT .ucStallDtctn_Ref3Strom = 56, // 'CddStp_tCodingAreaLwr.Strom.ucRef3NT' - 3x the same: TT, NT, HT .unStallDtctn_unResHsZeitU1 = 0, // .unStallDtctn_unResHsZeitO1 = 0, // .unStallDtctn_unResHsZeitU2 = 0, // .unStallDtctn_unResHsZeitO2 = 0, // .unStallDtctn_HsZeitRef1 = 1506, // .unStallDtctn_HsZeitRef2 = 4082, // .unStallDtctn_HsZeitRef3 = 10000, // .unStallDtctn_unHsAnzahlRef2 = 300, // .unStallDtctn_Vmin = 100, // 'CddStp_tCodingAreaLwr.Dynamik.unVmin' .unStallDtctn_Vmax = 800, // .unStallDtctn_Acc = 12000, // .unStallDtctn_Richtung = 0, // .boStallDtctn_TestOlIgnor = FALSE }, // .controlRegisters = { .ucStallDtctn_STALL_TH = 0x1A, // Stall - Detection threshold // .bStallDtctn_STL_LRN = FALSE, // Stall learn .bStallDtctn_EN_STL = FALSE, // Stall enable .bStallDtctn_STL_REP = FALSE }, // 1b = Stall detection is reported on nFAULT .bStallDtctn_StopAtStall = FALSE, .lStallDtctn_PosAtStop = 0, // position in the moment of Stall-Condition starts .bStallDtctn_WriteCReg6Once = FALSE, // usually do READ CReg-6 - only on request do WRITE ONCE .bStallDtctn_WriteClrFltOnce = FALSE, // usually 'CLR_FLT' in CReg4 is '0' - only on request do WRITE ONCE '1' // .bStallDtctn_WriteStlLrnOnce = FALSE // usually 'STL_LRN' in CReg5 is '0' - only on request do WRITE ONCE '1' .bStallDtctn_WriteStlLrn = FALSE, // usually 'STL_LRN' in CReg5 is '0' - only on request do WRITE '1' .unStallDtctn_SpeedViaTime = 1506 // '1506' is typicall 'Ref-Speed' - the smaller the faster }; //============================================================================= // Macros //============================================================================= //============================================================================= // Prototpes //============================================================================= //============================================================================= // Function definitions //============================================================================= //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_IsSimActive /// /// \descr Return TRUE if the simulation interface has been actived with password /// /// \param - /// /// \return boolean - Return TRUE if the simulation interface has been actived with password //----------------------------------------------------------------------------- boolean CddStp_Simulation_IsSimActive(void) { return (CddStp_Simulation_Data.ulSimActivated == CDDSTP_SIMULATION_PASSWORD) ? TRUE : FALSE; // '0xC0DE1234u' } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_HandleSpiRxStatusBits /// /// \descr Do GET the 'Simulation'-Bits - yet no 'real' handling/simulation /// /// \param pboSim_DriverDefect /// \param pboSim_SPI_ERROR_SpiProtocolError /// \param pboSim_UVLO_UnderVoltageLockout /// \param pboSim_CPUV_ChargePumpUndervoltage /// \param pboSim_OCP_OverCurrentProtection /// \param pboSim_OL_OpenLoad /// \param pboSim_OTW_OverThermalWarning /// \param pboSim_OTS_OverTemperatureShutdown /// \param pboSim_UTW_UnderTemperatureWarning /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_HandleSpiRxStatusBits(boolean * pboSim_DriverDefect, boolean * pboSim_SPI_ERROR_SpiProtocolError , boolean * pboSim_UVLO_UnderVoltageLockout , boolean * pboSim_CPUV_ChargePumpUndervoltage, boolean * pboSim_OCP_OverCurrentProtection , boolean * pboSim_OL_OpenLoad /*, boolean * pboSim_TF_ThermalFault*/ , boolean * pboSim_OTW_OverThermalWarning , boolean * pboSim_OTS_OverTemperatureShutdown, boolean * pboSim_UTW_UnderTemperatureWarning) { if (CddStp_Simulation_IsSimActive() != FALSE) { // if (CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError != eSimuHandling_Inactive) *pboSim_DriverDefect = (CddStp_Simulation_Data.ucSim_DriverDefect == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_SPI_ERROR_SpiProtocolError = (CddStp_Simulation_Data.ucSim_SPI_ERROR_SpiProtocolError == eSimuHandling_Active) ? TRUE : FALSE; if (CddStp_Simulation_Data.unSim_SPI_ERROR_SpiProtocolErrCnt > 0u) { CddStp_Simulation_Data.unSim_SPI_ERROR_SpiProtocolErrCnt--; // decr. each time *pboSim_SPI_ERROR_SpiProtocolError = TRUE; } *pboSim_OL_OpenLoad = (CddStp_Simulation_Data.ucSim_OL_OpenLoad == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_OCP_OverCurrentProtection = (CddStp_Simulation_Data.ucSim_OCP_OverCurrentProtection == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_UVLO_UnderVoltageLockout = (CddStp_Simulation_Data.ucSim_UVLO_UnderVoltageLockout == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_CPUV_ChargePumpUndervoltage = (CddStp_Simulation_Data.ucSim_CPUV_ChargePumpUndervoltage == eSimuHandling_Active) ? TRUE : FALSE; //*pboSim_TF_ThermalFault = (CddStp_Simulation_Data.ucSim_TF_ThermalFault == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_OTW_OverThermalWarning = (CddStp_Simulation_Data.ucSim_OTW_OverThermalWarning == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_OTS_OverTemperatureShutdown = (CddStp_Simulation_Data.ucSim_OTS_OverTemperatureShutdown == eSimuHandling_Active) ? TRUE : FALSE; *pboSim_UTW_UnderTemperatureWarning = (CddStp_Simulation_Data.ucSim_UTW_UnderTemperatureWarning == eSimuHandling_Active) ? TRUE : FALSE; } else // sim is NOT active { // MISRA } // PRQA S 5328 1 // program architecture and readability - intentionally no modification of existing code - warning - QAC(Prio2) Msg : 5328(HIS metrics violation : 'CddStp8899Com_Simulation_HandleSpiRxStatusBits() : STPAR = 8' exceeds threshold 5 for Number of function parameters(STPAR).) } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_HandleVBatt_EcuSupply /// /// \descr VBatt in mV /// Magic-Number: CDDSTP_SIMULATION_UNUSED_VALUE ('0xFFFF') -> do NOT use value /// /// \param punVoltage_mV /// /// \return boolean //----------------------------------------------------------------------------- boolean CddStp_Simulation_HandleVBatt_EcuSupply(uint16 * punVoltage_mV) { *punVoltage_mV = CddStp_Simulation_Data.unVBatt_EcuSupply_mV; // Magic-Number: CDDSTP_SIMULATION_UNUSED_VALUE ('0xFFFF') return (*punVoltage_mV == CDDSTP_SIMULATION_UNUSED_VALUE) ? FALSE : TRUE; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_HandleDriverDefect_FatalError /// /// \descr /// /// \param - /// /// \return boolean //----------------------------------------------------------------------------- boolean CddStp_Simulation_HandleDriverDefect_FatalError(void) { return (CddStp_Simulation_Data.ucSim_DriverDefect == eSimuHandling_Active) ? TRUE : FALSE; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_HandleLowTempMode /// /// \descr /// /// \param - /// /// \return boolean //----------------------------------------------------------------------------- boolean CddStp_Simulation_HandleLowTempMode(void) { return (CddStp_Simulation_Data.ucSim_LT_IsLowTemperature == eSimuHandling_Active) ? TRUE : FALSE; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_UpdateStatusRegisters /// /// \descr /// /// \param 4x Status-Register: ucBasic, ucFault, ucDiagStatus1, ucDiagStatus2 /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_HandleStatusRegisters(uint8 *pucBasic, uint8 *pucFault, uint8 *pucDiagStatus1, uint8 *pucDiagStatus2) { // 'simulation' is NOT active -> update internal vars if (CddStp_Simulation_IsSimActive() == FALSE) { // store 'correct' values for later use CddStp_Simulation_Data.ucSim_StReg_Basic = *pucBasic; CddStp_Simulation_Data.ucSim_StReg_Fault = *pucFault; CddStp_Simulation_Data.ucSim_StReg_DiagStatus1 = *pucDiagStatus1; CddStp_Simulation_Data.ucSim_StReg_DiagStatus2 = *pucDiagStatus2; } else // sim is active { *pucBasic = CddStp_Simulation_Data.ucSim_StReg_Basic; *pucFault = CddStp_Simulation_Data.ucSim_StReg_Fault; *pucDiagStatus1 = CddStp_Simulation_Data.ucSim_StReg_DiagStatus1; *pucDiagStatus2 = CddStp_Simulation_Data.ucSim_StReg_DiagStatus2; } } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn /// /// \descr Handle Pre-Evaluation Stall-Detection /// Usually called in 'CddStp88XX_Cycle0' /// /// \param - /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn(void) { if (CddStp_Simulation_IsSimActive() == TRUE) { if (CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce == TRUE) { CddStp88XX_PreEvalStallDtctn(); // 'CddStp_ReadCodingData()' CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce = FALSE; // reset at once } CddStp8899Com_PreEvalStallDtctn(); // set some Ctrl-Regs } } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce /// /// \descr /// /// \param - /// /// \return boolean //----------------------------------------------------------------------------- boolean CddStp_Simulation_PreEvalStallDtctn_ReadCodingOnce(void) { return ( (CddStp_Simulation_IsSimActive() == TRUE) && (CddStp_Simulation_Data.bStallDtctn_ReadCodingOnce == TRUE)) ? TRUE : FALSE; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_SetCodingParams /// /// \descr /// /// \param pCodingParams /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_SetCodingParams(tCddStp_Simulation_PreEvalStallDtctn_CodingParams * pCodingParams) { CddStp_Simulation_Data.codingParams.ucStallDtctn_Haltestrom = pCodingParams->ucStallDtctn_Haltestrom; CddStp_Simulation_Data.codingParams.ucStallDtctn_Fahrstrom = pCodingParams->ucStallDtctn_Fahrstrom; CddStp_Simulation_Data.codingParams.ucStallDtctn_Ref3Strom = pCodingParams->ucStallDtctn_Ref3Strom; CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitU1 = pCodingParams->unStallDtctn_unResHsZeitU1; CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitO1 = pCodingParams->unStallDtctn_unResHsZeitO1; CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitU2 = pCodingParams->unStallDtctn_unResHsZeitU2; CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitO2 = pCodingParams->unStallDtctn_unResHsZeitO2; CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef1 = pCodingParams->unStallDtctn_HsZeitRef1; CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef2 = pCodingParams->unStallDtctn_HsZeitRef2; CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef3 = pCodingParams->unStallDtctn_HsZeitRef3; CddStp_Simulation_Data.codingParams.unStallDtctn_unHsAnzahlRef2 = pCodingParams->unStallDtctn_unHsAnzahlRef2; CddStp_Simulation_Data.codingParams.unStallDtctn_Vmax = pCodingParams->unStallDtctn_Vmax; CddStp_Simulation_Data.codingParams.unStallDtctn_Vmin = pCodingParams->unStallDtctn_Vmin; CddStp_Simulation_Data.codingParams.unStallDtctn_Acc = pCodingParams->unStallDtctn_Acc; CddStp_Simulation_Data.codingParams.unStallDtctn_Richtung = pCodingParams->unStallDtctn_Richtung; CddStp_Simulation_Data.codingParams.boStallDtctn_TestOlIgnor = pCodingParams->boStallDtctn_TestOlIgnor; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetCodingParams /// /// \descr /// /// \param pCodingParams /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_GetCodingParams(tCddStp_Simulation_PreEvalStallDtctn_CodingParams * pCodingParams) { pCodingParams->ucStallDtctn_Haltestrom = CddStp_Simulation_Data.codingParams.ucStallDtctn_Haltestrom; pCodingParams->ucStallDtctn_Fahrstrom = CddStp_Simulation_Data.codingParams.ucStallDtctn_Fahrstrom; pCodingParams->ucStallDtctn_Ref3Strom = CddStp_Simulation_Data.codingParams.ucStallDtctn_Ref3Strom; pCodingParams->unStallDtctn_unResHsZeitU1 = CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitU1; pCodingParams->unStallDtctn_unResHsZeitO1 = CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitO1; pCodingParams->unStallDtctn_unResHsZeitU2 = CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitU2; pCodingParams->unStallDtctn_unResHsZeitO2 = CddStp_Simulation_Data.codingParams.unStallDtctn_unResHsZeitO2; pCodingParams->unStallDtctn_HsZeitRef1 = CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef1; pCodingParams->unStallDtctn_HsZeitRef2 = CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef2; pCodingParams->unStallDtctn_HsZeitRef3 = CddStp_Simulation_Data.codingParams.unStallDtctn_HsZeitRef3; pCodingParams->unStallDtctn_unHsAnzahlRef2 = CddStp_Simulation_Data.codingParams.unStallDtctn_unHsAnzahlRef2; pCodingParams->unStallDtctn_Vmax = CddStp_Simulation_Data.codingParams.unStallDtctn_Vmax; pCodingParams->unStallDtctn_Vmin = CddStp_Simulation_Data.codingParams.unStallDtctn_Vmin; pCodingParams->unStallDtctn_Acc = CddStp_Simulation_Data.codingParams.unStallDtctn_Acc; pCodingParams->unStallDtctn_Richtung = CddStp_Simulation_Data.codingParams.unStallDtctn_Richtung; pCodingParams->boStallDtctn_TestOlIgnor = CddStp_Simulation_Data.codingParams.boStallDtctn_TestOlIgnor; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetControlRegs /// /// \descr /// /// \param pControlRegisters /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_GetControlRegs(tCddStp_Simulation_PreEvalStallDtctn_CtrlReg * pControlRegisters) { pControlRegisters->bStallDtctn_EN_STL = CddStp_Simulation_Data.controlRegisters.bStallDtctn_EN_STL; //pControlRegisters->bStallDtctn_STL_LRN = CddStp_Simulation_Data.controlRegisters.bStallDtctn_STL_LRN; pControlRegisters->bStallDtctn_STL_REP = CddStp_Simulation_Data.controlRegisters.bStallDtctn_STL_REP; pControlRegisters->ucStallDtctn_STALL_TH = CddStp_Simulation_Data.controlRegisters.ucStallDtctn_STALL_TH; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall /// /// \descr /// /// \param lPosAtStop /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_SetPosAtStall(sint32 lPosAtStop) { CddStp_Simulation_Data.lStallDtctn_PosAtStop = lPosAtStop; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall /// /// \descr /// /// \param - /// /// \return sint32 //----------------------------------------------------------------------------- sint32 CddStp_Simulation_PreEvalStallDtctn_GetPosAtStall(void) { return CddStp_Simulation_Data.lStallDtctn_PosAtStop; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once /// /// \descr usually do READ CReg-6 - only on request do WRITE ONCE /// /// \param - /// /// \return boolean //----------------------------------------------------------------------------- boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteCReg6Once(void) { boolean bSimIsActive = CddStp_Simulation_IsSimActive(); boolean bResult = ((CddStp_Simulation_Data.bStallDtctn_WriteCReg6Once == TRUE) && (bSimIsActive == TRUE)) ? TRUE : FALSE; CddStp_Simulation_Data.bStallDtctn_WriteCReg6Once = FALSE; // reset at once return bResult; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce /// /// \descr usually 'CLR_FLT' in CReg4 is '0' - only on request do WRITE ONCE '1' /// /// \param - /// /// \return int //----------------------------------------------------------------------------- boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteClrFltOnce(void) { boolean bSimIsActive = CddStp_Simulation_IsSimActive(); boolean bResult = ((CddStp_Simulation_Data.bStallDtctn_WriteClrFltOnce == TRUE) && (bSimIsActive == TRUE)) ? TRUE : FALSE; CddStp_Simulation_Data.bStallDtctn_WriteClrFltOnce = FALSE; // reset at once return bResult; } // //----------------------------------------------------------------------------- // /// \brief CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrnOnce // /// // /// \descr usually 'STL_LRN' in CReg5 is '0' - only on request do WRITE ONCE '1' // /// // /// \param - // /// // /// \return int // //----------------------------------------------------------------------------- // boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrnOnce(void) // { // boolean bResult = CddStp_Simulation_Data.bStallDtctn_WriteStlLrnOnce && CddStp_Simulation_IsSimActive(); // CddStp_Simulation_Data.bStallDtctn_WriteStlLrnOnce = FALSE; // reset at once // // return bResult; // } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn /// /// \descr usually 'STL_LRN' in CReg5 is '0' - only on request do WRITE '1' /// /// \param - /// /// \return int //----------------------------------------------------------------------------- boolean CddStp_Simulation_PreEvalStallDtctn_GetWriteStlLrn(void) { boolean bSimIsActive = CddStp_Simulation_IsSimActive(); boolean bResult = ((CddStp_Simulation_Data.bStallDtctn_WriteStlLrn == TRUE) && (bSimIsActive == TRUE)) ? TRUE : FALSE; // do NOT reset here at once ... but after sucessful learning 'STL_LRN_OK' return bResult; } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn /// /// \descr /// /// \param - /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_ResetStlLrn(void) { // CddStp_Simulation_Data.bStallDtctn_WriteStlLrnOnce = FALSE; // reset CddStp_Simulation_Data.bStallDtctn_WriteStlLrn = FALSE; // reset } //----------------------------------------------------------------------------- /// \brief CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed /// /// \descr Set 'DEBUG'-Speed in CtrlStp during 'eStpSrc_NormalPos' /// '1506' is typicall 'Ref-Speed' - the smaller the faster /// /// \param punTmin /// /// \return void //----------------------------------------------------------------------------- void CddStp_Simulation_PreEvalStallDtctn_GetStpSpeed(uint16 * punTmin) { boolean bSimIsActive = CddStp_Simulation_IsSimActive(); if (bSimIsActive == TRUE) { *punTmin = CddStp_Simulation_Data.unStallDtctn_SpeedViaTime; } else { CddStp_Simulation_Data.unStallDtctn_SpeedViaTime = *punTmin; // store 'valid' value for later use } } #endif // CDDSTP_CFG_SIMULATION // EOF