Skip to content

Commit d8e70b0

Browse files
committed
dut_power: change the indentation level of the voltage/current checks
This does not introduce any changes and only serves to make the diff in the next commit more readable. Signed-off-by: Leonard Göhrs <[email protected]>
1 parent bc7a6db commit d8e70b0

File tree

1 file changed

+39
-37
lines changed

1 file changed

+39
-37
lines changed

src/dut_power.rs

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -413,45 +413,47 @@ impl DutPwrThread {
413413
.swap(OutputRequest::Idle as u8, Ordering::Relaxed)
414414
.into();
415415

416-
// Don't even look at the requests if there is an ongoing
417-
// overvoltage condition. Instead turn the output off and
418-
// go back to measuring.
419-
if volt > MAX_VOLTAGE {
420-
turn_off_with_reason(
421-
OutputState::OverVoltage,
422-
&pwr_line,
423-
&discharge_line,
424-
&state,
425-
);
426-
427-
continue;
428-
}
416+
{
417+
// Don't even look at the requests if there is an ongoing
418+
// overvoltage condition. Instead turn the output off and
419+
// go back to measuring.
420+
if volt > MAX_VOLTAGE {
421+
turn_off_with_reason(
422+
OutputState::OverVoltage,
423+
&pwr_line,
424+
&discharge_line,
425+
&state,
426+
);
429427

430-
// Don't even look at the requests if there is an ongoin
431-
// polarity inversion. Turn off, go back to start, do not
432-
// collect $200.
433-
if volt < MIN_VOLTAGE {
434-
turn_off_with_reason(
435-
OutputState::InvertedPolarity,
436-
&pwr_line,
437-
&discharge_line,
438-
&state,
439-
);
440-
441-
continue;
442-
}
428+
continue;
429+
}
443430

444-
// Don't even look at the requests if there is an ongoin
445-
// overcurrent condition.
446-
if curr > MAX_CURRENT {
447-
turn_off_with_reason(
448-
OutputState::OverCurrent,
449-
&pwr_line,
450-
&discharge_line,
451-
&state,
452-
);
453-
454-
continue;
431+
// Don't even look at the requests if there is an ongoin
432+
// polarity inversion. Turn off, go back to start, do not
433+
// collect $200.
434+
if volt < MIN_VOLTAGE {
435+
turn_off_with_reason(
436+
OutputState::InvertedPolarity,
437+
&pwr_line,
438+
&discharge_line,
439+
&state,
440+
);
441+
442+
continue;
443+
}
444+
445+
// Don't even look at the requests if there is an ongoin
446+
// overcurrent condition.
447+
if curr > MAX_CURRENT {
448+
turn_off_with_reason(
449+
OutputState::OverCurrent,
450+
&pwr_line,
451+
&discharge_line,
452+
&state,
453+
);
454+
455+
continue;
456+
}
455457
}
456458

457459
// There is no ongoing fault condition, so we could e.g. turn

0 commit comments

Comments
 (0)