70
70
71
71
#define ET_NBR_PINS 7
72
72
73
- #define RPM_TEST_LOWER_LIMIT 12000
74
73
#define MOTOR_TEST_PWM (UINT16_MAX/2)
75
74
#define MOTOR_TEST_TIME_MILLIS 2000
76
75
#define MOTOR_FEED_SIGNAL_INTVL 1
@@ -103,6 +102,7 @@ static EtGpio etGpioIn[ET_NBR_PINS] = {
103
102
static bool isInit ;
104
103
const DeckDriver * bcRpm = NULL ;
105
104
static motorRpmParams_t motorRpm = {0 };
105
+ static uint32_t rpmResult [4 ] = {0 ,0 ,0 ,0 };
106
106
107
107
static void expCfBlTestInit (DeckInfo * info )
108
108
{
@@ -166,10 +166,9 @@ static void runMotors()
166
166
167
167
static bool rpmTestRun (void )
168
168
{
169
- bool passed = true;
170
169
uint16_t testTime = MOTOR_TEST_TIME_MILLIS ;
171
170
int32_t waitTime = MOTOR_TEST_TIME_MILLIS ;
172
- int32_t rpmSamples [] = {0 ,0 ,0 ,0 };
171
+ uint32_t rpmSamples [] = {0 ,0 ,0 ,0 };
173
172
setMotorsPwm (0 );
174
173
while (waitTime ) { //We need to wait until all ESCs are started. We need to feed a signal continuosly so they dont go to sleep
175
174
runMotors ();
@@ -187,11 +186,11 @@ static bool rpmTestRun(void)
187
186
188
187
setMotorsPwm (0 );
189
188
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 ;
193
191
}
194
- return passed ;
192
+
193
+ return true; //Return True here regardless. This should be checked externally
195
194
}
196
195
197
196
static bool expCfBlTestRun (void )
@@ -272,4 +271,10 @@ static const DeckDriver expCfBltest_deck = {
272
271
.test = expCfBlTestRun
273
272
};
274
273
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 )
275
280
DECK_DRIVER (expCfBltest_deck );
0 commit comments