diff --git a/SDM.cpp b/SDM.cpp index f496c46..6c8a87b 100644 --- a/SDM.cpp +++ b/SDM.cpp @@ -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()) { @@ -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) { @@ -217,7 +217,7 @@ void SDM::setMsTimeout(uint16_t _mstimeout) { } uint16_t SDM::getMsTurnaround() { - return (msturnarount); + return (msturnaround); } uint16_t SDM::getMsTimeout() { diff --git a/SDM.h b/SDM.h index bebeb90..7d9430b 100644 --- a/SDM.h +++ b/SDM.h @@ -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) @@ -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