Skip to content

Commit

Permalink
Added the result from exptest deck driver to param variables
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ToveRumar committed Oct 24, 2024
1 parent e0df606 commit 506c3ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/deck/drivers/src/test/exptestCfBl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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};
Expand All @@ -189,9 +188,10 @@ static bool rpmTestRun(void)
for (int i = 0; i<NBR_OF_MOTORS; i++) {
int rpmAvg = rpmSamples[i] / MOTOR_RPM_NBR_SAMPLES;
DEBUG_PRINT("Motor; %d RPM; %d\n", i, rpmAvg);
passed &= (rpmAvg > RPM_TEST_LOWER_LIMIT);
rpmResult[i] = rpmAvg;
}
return passed;

return true; //Return True here regardless. This should be checked externally
}

static bool expCfBlTestRun(void)
Expand Down Expand Up @@ -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);

0 comments on commit 506c3ad

Please sign in to comment.