Skip to content

Commit

Permalink
refactor: name thread sleep delay constant
Browse files Browse the repository at this point in the history
  • Loading branch information
vtx22 committed Mar 7, 2025
1 parent 1bc2ecc commit d1f21fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DataHandler::DataHandler(Serial *sp, ConsoleWindow *console_window) : _sp(sp), _
_serial_buffer.reserve(SPARQ_MAX_MESSAGE_LENGTH * 2);

_receive_thread = std::thread(&DataHandler::receiver_loop, this);
std::cout << "Starting receiver thread\n";
std::cout << "Starting receiver thread ...\n";
}

DataHandler::~DataHandler()
Expand Down Expand Up @@ -39,7 +39,7 @@ void DataHandler::receiver_loop()
lock.unlock();
}

std::this_thread::sleep_for(1ms);
std::this_thread::sleep_for(SPARQ_RECEIVE_LOOP_DELAY);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/DataHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <atomic>
#include <mutex>

#include "sparq_config.h"
#include "sparq_types.hpp"
#include "serial.hpp"
#include "implot.h"
Expand Down
2 changes: 2 additions & 0 deletions src/sparq_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
#define SPARQ_CONFIG_FILE "config.ini"
#define SPARQ_ICON_FILE "./assets/icon.png"

#define SPARQ_RECEIVE_LOOP_DELAY 1ms

constexpr bool SPARQ_PLATFORM_LITTLE_ENDIAN = true;

0 comments on commit d1f21fc

Please sign in to comment.