Skip to content

Commit

Permalink
timing
Browse files Browse the repository at this point in the history
  • Loading branch information
bertmelis authored Oct 2, 2024
1 parent ccf219c commit fdfd12a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VS1/VS1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void VS1::_init() {
// if we want to send something within 50msec of receiving the ENQ, send ENQ_ACK and move to SEND
// if > 50msec, return to INIT
void VS1::_syncEnq() {
if (_currentMillis - _lastMillis > 50) {
if (_currentMillis - _lastMillis < 50) {
if (_currentDatapoint && _interface->write(&VitoWiFiInternals::ProtocolBytes.ENQ_ACK, 1) == 1) {
_setState(State::SEND);
_send(); // speed up things
Expand All @@ -240,7 +240,7 @@ void VS1::_syncEnq() {
// if we want to send something within 50msec of previous SEND, send again
// if > 50msec, return to INIT
void VS1::_syncRecv() {
if (_currentMillis - _lastMillis > 50) {
if (_currentMillis - _lastMillis < 50) {
if (_currentDatapoint) {
_setState(State::SEND);
}
Expand Down

0 comments on commit fdfd12a

Please sign in to comment.