Skip to content

Commit

Permalink
Add param to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Oct 18, 2024
1 parent 399dd77 commit c6bcc5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/analogIO/Wippersnapper_AnalogIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,16 @@ bool Wippersnapper_AnalogIO::encodePinEvent(
@brief Calculates the hysteresis for the pin value.
@param pin
The desired analog pin to calculate hysteresis for.
@param _pinValThreshHi
@param pinValRaw
The pin's raw value.
@param pinValThreshHi
The pin's high threshold value.
@param _pinValThreshLow
@param pinValThreshLow
The pin's low threshold value.
*/
/**********************************************************/
void calculateHysteresis(analogInputPin pin, uint16_t pinValRaw,
uint16_t _pinValThreshHi, uint16_t _pinValThreshLow) {
uint16_t pinValThreshHi, uint16_t pinValThreshLow) {
// All boards ADC values scaled to 16bit, in future we may need to
// adjust dynamically
uint16_t maxDecimalValue = 65535;
Expand All @@ -342,8 +344,8 @@ void calculateHysteresis(analogInputPin pin, uint16_t pinValRaw,
}

// get the threshold values for previous pin value
_pinValThreshHi = pin.prvPinVal + CURRENT_HYSTERISIS;
_pinValThreshLow = pin.prvPinVal - CURRENT_HYSTERISIS;
pinValThreshHi = pin.prvPinVal + CURRENT_HYSTERISIS;
pinValThreshLow = pin.prvPinVal - CURRENT_HYSTERISIS;
}

/**********************************************************/
Expand Down
2 changes: 2 additions & 0 deletions src/components/analogIO/Wippersnapper_AnalogIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class Wippersnapper_AnalogIO {
int pin);
void disableAnalogInPin(int pin);

void calculateHysteresis(analogInputPin pin, uint16_t pinValRaw,
uint16_t &_pinValThreshHi, uint16_t &_pinValThreshLow);
uint16_t getPinValue(int pin);
float getPinValueVolts(int pin);

Expand Down

0 comments on commit c6bcc5c

Please sign in to comment.