File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ void InlineCurrentSense::calibrateOffsets(){
61
61
offset_ic = 0 ;
62
62
// read the adc voltage 1000 times ( arbitrary number )
63
63
for (int i = 0 ; i < calibration_rounds; i++) {
64
+ _startADC3PinConversionInline ();
64
65
if (_isset (pinA)) offset_ia += _readADCVoltageInline (pinA, params);
65
66
if (_isset (pinB)) offset_ib += _readADCVoltageInline (pinB, params);
66
67
if (_isset (pinC)) offset_ic += _readADCVoltageInline (pinC, params);
@@ -75,6 +76,7 @@ void InlineCurrentSense::calibrateOffsets(){
75
76
// read all three phase currents (if possible 2 or 3)
76
77
PhaseCurrent_s InlineCurrentSense::getPhaseCurrents (){
77
78
PhaseCurrent_s current;
79
+ _startADC3PinConversionInline ();
78
80
current.a = (!_isset (pinA)) ? 0 : (_readADCVoltageInline (pinA, params) - offset_ia)*gain_a;// amps
79
81
current.b = (!_isset (pinB)) ? 0 : (_readADCVoltageInline (pinB, params) - offset_ib)*gain_b;// amps
80
82
current.c = (!_isset (pinC)) ? 0 : (_readADCVoltageInline (pinC, params) - offset_ic)*gain_c; // amps
Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ void IRAM_ATTR _startADC3PinConversionLowSide()
242
242
#endif
243
243
}
244
244
245
+ void IRAM_ATTR _startADC3PinConversionInline (){
246
+ _startADC3PinConversionLowSide ();
247
+ }
248
+
245
249
// Takes the buffered adc counts and returns the coresponding float voltage for a pin.
246
250
float IRAM_ATTR _readADCVoltageI2S (const int pin, const void *cs_params)
247
251
{
You can’t perform that action at this time.
0 commit comments