Skip to content

Commit

Permalink
fix variable name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
reaper7 committed Nov 3, 2021
1 parent efabfee commit f651471
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions SDM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ float SDM::readVal(uint16_t reg, uint8_t node) {

dereSet(LOW); //receive from SDM -> DE Disable, /RE Enable (for control MAX485)

resptime = millis() + msturnarount;
resptime = millis() + msturnaround;

while (sdmSer.available() < FRAMESIZE) {
if (resptime < millis()) {
Expand Down Expand Up @@ -198,13 +198,13 @@ void SDM::clearSuccCount() {
readingsuccesscount = 0;
}

void SDM::setMsTurnaround(uint16_t _msturnarount) {
if (_msturnarount < SDM_MIN_DELAY)
msturnarount = SDM_MIN_DELAY;
else if (_msturnarount > SDM_MAX_DELAY)
msturnarount = SDM_MAX_DELAY;
void SDM::setMsTurnaround(uint16_t _msturnaround) {
if (_msturnaround < SDM_MIN_DELAY)
msturnaround = SDM_MIN_DELAY;
else if (_msturnaround > SDM_MAX_DELAY)
msturnaround = SDM_MAX_DELAY;
else
msturnarount = _msturnarount;
msturnaround = _msturnaround;
}

void SDM::setMsTimeout(uint16_t _mstimeout) {
Expand All @@ -217,7 +217,7 @@ void SDM::setMsTimeout(uint16_t _mstimeout) {
}

uint16_t SDM::getMsTurnaround() {
return (msturnarount);
return (msturnaround);
}

uint16_t SDM::getMsTimeout() {
Expand Down
4 changes: 2 additions & 2 deletions SDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class SDM {
void clearErrCode(); // clear last errorcode
void clearErrCount(); // clear total errors count
void clearSuccCount(); // clear total success count
void setMsTurnaround(uint16_t _msturnarount = WAITING_TURNAROUND_DELAY); // set new value for WAITING_TURNAROUND_DELAY (ms), min=SDM_MIN_DELAY, max=SDM_MAX_DELAY
void setMsTurnaround(uint16_t _msturnaround = WAITING_TURNAROUND_DELAY); // set new value for WAITING_TURNAROUND_DELAY (ms), min=SDM_MIN_DELAY, max=SDM_MAX_DELAY
void setMsTimeout(uint16_t _mstimeout = RESPONSE_TIMEOUT); // set new value for RESPONSE_TIMEOUT (ms), min=SDM_MIN_DELAY, max=SDM_MAX_DELAY
uint16_t getMsTurnaround(); // get current value of WAITING_TURNAROUND_DELAY (ms)
uint16_t getMsTimeout(); // get current value of RESPONSE_TIMEOUT (ms)
Expand Down Expand Up @@ -287,7 +287,7 @@ class SDM {
long _baud = SDM_UART_BAUD;
int _dere_pin = DERE_PIN;
uint16_t readingerrcode = SDM_ERR_NO_ERROR; // 4 = timeout; 3 = not enough bytes; 2 = number of bytes OK but bytes b0,b1 or b2 wrong, 1 = crc error
uint16_t msturnarount = WAITING_TURNAROUND_DELAY;
uint16_t msturnaround = WAITING_TURNAROUND_DELAY;
uint16_t mstimeout = RESPONSE_TIMEOUT;
uint32_t readingerrcount = 0; // total errors counter
uint32_t readingsuccesscount = 0; // total success counter
Expand Down

0 comments on commit f651471

Please sign in to comment.