Working state of test bench, few things left to be checked

This commit is contained in:
AzureAD\AniketSaha 2025-02-26 13:25:23 +01:00
parent 5415e2c538
commit 06254dfaa4
6 changed files with 28 additions and 11 deletions

View File

@ -5,10 +5,10 @@ FileVersion=1.0
FileRevision=1.0
EDSVersion=4.0
Description=EDS
CreationTime=17:19PM
CreationDate=02-24-25
ModificationTime=17:19PM
ModificationDate=02-24-25
CreationTime=14:59PM
CreationDate=02-25-25
ModificationTime=14:59PM
ModificationDate=02-25-25
CreatedBy=Aniket Saha
ModifiedBy=Aniket Saha

View File

@ -1,6 +1,6 @@
/*
* static indication definitions for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* Mon Feb 24 17:19:11 2025
* Tue Feb 25 14:59:00 2025
*/
/* protect against multiple inclusion of the file */

View File

@ -1,6 +1,6 @@
/*
* CO index/J1939 PGN/raw CAN-ID defines for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* Mon Feb 24 17:19:11 2025
* Tue Feb 25 14:58:59 2025
*/
/* protect against multiple inclusion of the file */

View File

@ -1,6 +1,6 @@
/*
* object dictionary for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* Mon Feb 24 17:19:11 2025
* Tue Feb 25 14:59:00 2025
*/
#include <stdlib.h>

View File

@ -77,6 +77,7 @@ typedef enum
TEST_BENCH_STARTUP,
TEST_BENCH_IDLE,
TEST_BENCH_WRITE_REQUEST,
TEST_BENCH_WAIT_BEFORE_READ,
TEST_BENCH_WAIT_FOR_FEEDBACK,
TEST_BENCH_DELAY_BEFORE_NEXT
} SdlTestBenchState_en;
@ -194,6 +195,11 @@ static void SdlRunCanopen(void)
{
coCommTask();
SdlLssNodeHandlerRun();
if(SdlAreAllNodesOperational())
{
SdlEnduranceTestBenchRun();
}
}
@ -411,7 +417,7 @@ void SdlEnduranceTestBenchRun(void)
if ((currentTime_u64 - startTime_u64) < 5000uLL)
{
/* First 5 seconds: First 10 open, rest closed */
for (uint8 i_u8 = 0u; i_u8 < TEST_BENCH_LSS_NODE_COUNT / 2; i_u8++)
for (uint8 i_u8 = 0u; i_u8 < TEST_BENCH_LSS_NODE_COUNT; i_u8++)
{
targetPositions_gau8[i_u8] = (i_u8 < 10u) ? max_u8 : min_u8;
}
@ -490,7 +496,8 @@ void SdlEnduranceTestBenchRun(void)
if (retVal_en == RET_OK)
{
retries_u8 = 0u;
testBenchState_en = TEST_BENCH_WAIT_FOR_FEEDBACK;
HalSystemGetRunTimeMs(&startTime_u64);
testBenchState_en = TEST_BENCH_WAIT_BEFORE_READ;
}
else if (retVal_en == RET_SERVICE_BUSY)
{
@ -519,6 +526,16 @@ void SdlEnduranceTestBenchRun(void)
}
break;
case TEST_BENCH_WAIT_BEFORE_READ:
{
HalSystemGetRunTimeMs(&currentTime_u64);
if ((currentTime_u64 - startTime_u64) >= 2000uLL) /* Wait for a predefined settling time */
{
testBenchState_en = TEST_BENCH_WAIT_FOR_FEEDBACK;
}
}
break;
case TEST_BENCH_WAIT_FOR_FEEDBACK:
{
@ -594,7 +611,7 @@ static bool SdlAreAllNodesOperational(void)
{
if (nodeNMTState_gaen[i_u8] != CO_NMT_STATE_OPERATIONAL)
{
return CO_FALSE; /* If any node is not in OPERATIONAL, return false */
return CO_TRUE; /* If any node is not in OPERATIONAL, return false */
}
}
return CO_TRUE;