Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Aug 3, 2023
1 parent 4aaf186 commit 1f06549
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions wpilibc/src/main/native/include/frc/PowerDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ class PowerDistribution : public wpi::Sendable,
std::atomic<units::ohm_t> m_totalResistance;
frc::Notifier m_totalResistanceNotifier;

/**
* Calculate new total resistance.
*/
void UpdateResistance();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,17 @@ public PowerDistributionStickyFaults getStickyFaults() {
}

/**
* Get the robot's resistance. A {@link ResistanceCalculator} should have been passed in the
* constructor to enable calculating resistance.
* Get the robot's resistance.
*
* @return The robot resistance if a resistance calculator was given, {@code NaN} otherwise.
* @return The robot's resistance.
*/
public double getTotalResistance() {
return m_totalResistance.get();
}

/**
* Calculate new total resistance.
*/
private void updateResistance() {
m_totalResistance.set(
m_totalResistanceCalculator.calculate(this.getTotalCurrent(), this.getVoltage()));
Expand Down

0 comments on commit 1f06549

Please sign in to comment.