diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-05-23 02:56:37 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-05-23 22:59:46 +0300 |
commit | 5758e0315f9d27007575293760db6d389c2f4162 (patch) | |
tree | 3594078e4694e12c02f56f927be0d674159112bb /src/voltronic/pseudo_device.cc | |
parent | f0ba39a28bb7a42b0dd9755a6d759702a7e39258 (diff) |
device: separate high-priority thread for interacting with hwsched
Diffstat (limited to 'src/voltronic/pseudo_device.cc')
-rw-r--r-- | src/voltronic/pseudo_device.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/voltronic/pseudo_device.cc b/src/voltronic/pseudo_device.cc index 58cd95c..2c0015e 100644 --- a/src/voltronic/pseudo_device.cc +++ b/src/voltronic/pseudo_device.cc @@ -8,6 +8,7 @@ #include "crc.h" #include "hexdump/hexdump.h" #include "../logging.h" +#include "exceptions.h" namespace voltronic { @@ -26,7 +27,7 @@ static const char* response = "^D1060000,000,2300,500,0115,0018,002,500,000,000, // set response //static const char* response = "^1"; -// TODO: maybe move size and crc stuff to readLoop()? +// TODO: maybe move size and crc stuff to readAll()? size_t PseudoDevice::read(u8* buf, size_t bufSize) { size_t pseudoResponseSize = strlen(response); @@ -37,7 +38,7 @@ size_t PseudoDevice::read(u8* buf, size_t bufSize) { if (responseSize + 1 > bufSize) { std::ostringstream error; error << "buffer is not large enough (" << (responseSize + 1) << " > " << bufSize << ")"; - throw std::overflow_error(error.str()); + throw OverflowError(error.str()); } memcpy(buf, response, responseSize); |