Skip to content

Commit edc877f

Browse files
authored
Merge pull request #1427 from bitcraze/toverumar/update_rpm_limits
Expose production test rpm values as params
2 parents e0df606 + 1924968 commit edc877f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/deck/drivers/src/test/exptestCfBl.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070

7171
#define ET_NBR_PINS 7
7272

73-
#define RPM_TEST_LOWER_LIMIT 12000
7473
#define MOTOR_TEST_PWM (UINT16_MAX/2)
7574
#define MOTOR_TEST_TIME_MILLIS 2000
7675
#define MOTOR_FEED_SIGNAL_INTVL 1
@@ -103,6 +102,7 @@ static EtGpio etGpioIn[ET_NBR_PINS] = {
103102
static bool isInit;
104103
const DeckDriver *bcRpm = NULL;
105104
static motorRpmParams_t motorRpm = {0};
105+
static uint32_t rpmResult[4] = {0,0,0,0};
106106

107107
static void expCfBlTestInit(DeckInfo *info)
108108
{
@@ -166,10 +166,9 @@ static void runMotors()
166166

167167
static bool rpmTestRun(void)
168168
{
169-
bool passed = true;
170169
uint16_t testTime = MOTOR_TEST_TIME_MILLIS;
171170
int32_t waitTime = MOTOR_TEST_TIME_MILLIS;
172-
int32_t rpmSamples[] = {0,0,0,0};
171+
uint32_t rpmSamples[] = {0,0,0,0};
173172
setMotorsPwm(0);
174173
while (waitTime) { //We need to wait until all ESCs are started. We need to feed a signal continuosly so they dont go to sleep
175174
runMotors();
@@ -187,11 +186,11 @@ static bool rpmTestRun(void)
187186

188187
setMotorsPwm(0);
189188
for (int i = 0; i<NBR_OF_MOTORS; i++) {
190-
int rpmAvg = rpmSamples[i] / MOTOR_RPM_NBR_SAMPLES;
191-
DEBUG_PRINT("Motor; %d RPM; %d\n", i, rpmAvg);
192-
passed &= (rpmAvg > RPM_TEST_LOWER_LIMIT);
189+
uint32_t rpmAvg = rpmSamples[i] / MOTOR_RPM_NBR_SAMPLES;
190+
rpmResult[i] = rpmAvg;
193191
}
194-
return passed;
192+
193+
return true; //Return True here regardless. This should be checked externally
195194
}
196195

197196
static bool expCfBlTestRun(void)
@@ -272,4 +271,10 @@ static const DeckDriver expCfBltest_deck = {
272271
.test = expCfBlTestRun
273272
};
274273

274+
PARAM_GROUP_START(prodTestRpm)
275+
PARAM_ADD(PARAM_UINT32 | PARAM_RONLY, m1, &rpmResult[0])
276+
PARAM_ADD(PARAM_UINT32 | PARAM_RONLY, m2, &rpmResult[1])
277+
PARAM_ADD(PARAM_UINT32 | PARAM_RONLY, m3, &rpmResult[2])
278+
PARAM_ADD(PARAM_UINT32 | PARAM_RONLY, m4, &rpmResult[3])
279+
PARAM_GROUP_STOP(prodTestRpm)
275280
DECK_DRIVER(expCfBltest_deck);

0 commit comments

Comments
 (0)