Skip to content

Commit 5fc3128

Browse files
author
Richard Unger
committed
fix KV initialization bug
1 parent 505248c commit 5fc3128

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BLDCMotor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ BLDCMotor::BLDCMotor(int pp, float _R, float _KV, float _inductance)
4444
phase_resistance = _R;
4545
// save back emf constant KV = 1/KV
4646
// 1/sqrt(2) - rms value
47-
KV_rating = _KV*_SQRT2;
47+
KV_rating = NOT_SET;
48+
if (_isset(_KV))
49+
KV_rating = _KV*_SQRT2;
4850
// save phase inductance
4951
phase_inductance = _inductance;
5052

0 commit comments

Comments
 (0)