From 506c3ad9d2fd0bcaa64863be3e6b53497cf225ac Mon Sep 17 00:00:00 2001 From: Tove Rumar Date: Thu, 24 Oct 2024 10:30:09 +0200 Subject: [PATCH] Added the result from exptest deck driver to param variables This will make it possible to fetch individual motor results using the lib in production We can now scrap the result checking inside the FW and check the RPM in the production test instead --- src/deck/drivers/src/test/exptestCfBl.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/deck/drivers/src/test/exptestCfBl.c b/src/deck/drivers/src/test/exptestCfBl.c index 540e007653..7d63768619 100644 --- a/src/deck/drivers/src/test/exptestCfBl.c +++ b/src/deck/drivers/src/test/exptestCfBl.c @@ -70,7 +70,6 @@ #define ET_NBR_PINS 7 -#define RPM_TEST_LOWER_LIMIT 12000 #define MOTOR_TEST_PWM (UINT16_MAX/2) #define MOTOR_TEST_TIME_MILLIS 2000 #define MOTOR_FEED_SIGNAL_INTVL 1 @@ -103,6 +102,7 @@ static EtGpio etGpioIn[ET_NBR_PINS] = { static bool isInit; const DeckDriver *bcRpm = NULL; static motorRpmParams_t motorRpm = {0}; +static uint16_t rpmResult[4] = {0,0,0,0}; static void expCfBlTestInit(DeckInfo *info) { @@ -166,7 +166,6 @@ static void runMotors() static bool rpmTestRun(void) { - bool passed = true; uint16_t testTime = MOTOR_TEST_TIME_MILLIS; int32_t waitTime = MOTOR_TEST_TIME_MILLIS; int32_t rpmSamples[] = {0,0,0,0}; @@ -189,9 +188,10 @@ static bool rpmTestRun(void) for (int i = 0; i RPM_TEST_LOWER_LIMIT); + rpmResult[i] = rpmAvg; } - return passed; + + return true; //Return True here regardless. This should be checked externally } static bool expCfBlTestRun(void) @@ -272,4 +272,10 @@ static const DeckDriver expCfBltest_deck = { .test = expCfBlTestRun }; +PARAM_GROUP_START(prodTestRpm) +PARAM_ADD(PARAM_INT8 | PARAM_RONLY, m1, &rpmResult[0]) +PARAM_ADD(PARAM_INT8 | PARAM_RONLY, m2, &rpmResult[1]) +PARAM_ADD(PARAM_INT8 | PARAM_RONLY, m3, &rpmResult[2]) +PARAM_ADD(PARAM_INT8 | PARAM_RONLY, m4, &rpmResult[3]) +PARAM_GROUP_STOP(prodTestRpm) DECK_DRIVER(expCfBltest_deck);