Skip to content

Commit 7fd7f61

Browse files
Merge pull request #359 from Candas1/double_constants
Prevent double constants
2 parents 7b8c077 + 2a614dd commit 7fd7f61

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/current_sense/InlineCurrentSense.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ int InlineCurrentSense::driverAlign(float voltage){
156156
// read the current 50 times
157157
for (int i = 0; i < 100; i++) {
158158
PhaseCurrent_s c1 = getPhaseCurrents();
159-
c.a = c.a*0.6 + 0.4f*c1.a;
160-
c.b = c.b*0.6 + 0.4f*c1.b;
161-
c.c = c.c*0.6 + 0.4f*c1.c;
159+
c.a = c.a*0.6f + 0.4f*c1.a;
160+
c.b = c.b*0.6f + 0.4f*c1.b;
161+
c.c = c.c*0.6f + 0.4f*c1.c;
162162
_delay(3);
163163
}
164164
driver->setPwm(0, 0, 0);
@@ -203,9 +203,9 @@ int InlineCurrentSense::driverAlign(float voltage){
203203
// read the adc voltage 500 times ( arbitrary number )
204204
for (int i = 0; i < 100; i++) {
205205
PhaseCurrent_s c1 = getPhaseCurrents();
206-
c.a = c.a*0.6 + 0.4f*c1.a;
207-
c.b = c.b*0.6 + 0.4f*c1.b;
208-
c.c = c.c*0.6 + 0.4f*c1.c;
206+
c.a = c.a*0.6f + 0.4f*c1.a;
207+
c.b = c.b*0.6f + 0.4f*c1.b;
208+
c.c = c.c*0.6f + 0.4f*c1.c;
209209
_delay(3);
210210
}
211211
driver->setPwm(0, 0, 0);

src/current_sense/LowsideCurrentSense.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ int LowsideCurrentSense::driverAlign(float voltage){
157157
// read the current 50 times
158158
for (int i = 0; i < 100; i++) {
159159
PhaseCurrent_s c1 = getPhaseCurrents();
160-
c.a = c.a*0.6 + 0.4f*c1.a;
161-
c.b = c.b*0.6 + 0.4f*c1.b;
162-
c.c = c.c*0.6 + 0.4f*c1.c;
160+
c.a = c.a*0.6f + 0.4f*c1.a;
161+
c.b = c.b*0.6f + 0.4f*c1.b;
162+
c.c = c.c*0.6f + 0.4f*c1.c;
163163
_delay(3);
164164
}
165165
driver->setPwm(0, 0, 0);
@@ -204,9 +204,9 @@ int LowsideCurrentSense::driverAlign(float voltage){
204204
// read the adc voltage 500 times ( arbitrary number )
205205
for (int i = 0; i < 100; i++) {
206206
PhaseCurrent_s c1 = getPhaseCurrents();
207-
c.a = c.a*0.6 + 0.4f*c1.a;
208-
c.b = c.b*0.6 + 0.4f*c1.b;
209-
c.c = c.c*0.6 + 0.4f*c1.c;
207+
c.a = c.a*0.6f + 0.4f*c1.a;
208+
c.b = c.b*0.6f + 0.4f*c1.b;
209+
c.c = c.c*0.6f + 0.4f*c1.c;
210210
_delay(3);
211211
}
212212
driver->setPwm(0, 0, 0);

0 commit comments

Comments
 (0)