MultiChannelCommunication: Resolve MSVC constexpr warning

This commit is contained in:
Paul Hollinsky
2021-05-10 21:16:21 -04:00
parent 07afbebc6d
commit 6f8e073fd1
5 changed files with 48 additions and 23 deletions
@@ -18,7 +18,8 @@ public:
std::unique_ptr<Driver> com,
std::function<std::unique_ptr<Packetizer>()> makeConfiguredPacketizer,
std::unique_ptr<Encoder> e,
std::unique_ptr<Decoder> md) : Communication(err, std::move(com), makeConfiguredPacketizer, std::move(e), std::move(md)) {}
std::unique_ptr<Decoder> md,
size_t vnetCount);
void spawnThreads() override;
void joinThreads() override;
bool sendPacket(std::vector<uint8_t>& bytes) override;
@@ -27,8 +28,6 @@ protected:
bool preprocessPacket(std::deque<uint8_t>& usbReadFifo);
private:
static constexpr const size_t NUM_SUPPORTED_VNETS = 1;
enum class CommandType : uint8_t {
PlasmaReadRequest = 0x10, // Status read request to HSC
PlasmaStatusResponse = 0x11, // Status response by HSC
@@ -106,9 +105,10 @@ private:
CommandType currentCommandType;
size_t currentReadIndex = 0;
const size_t numVnets;
std::thread hidReadThread;
std::array<std::thread, NUM_SUPPORTED_VNETS> vnetThreads;
std::array<moodycamel::BlockingReaderWriterQueue< std::vector<uint8_t> >, NUM_SUPPORTED_VNETS> vnetQueues;
std::vector<std::thread> vnetThreads;
std::vector< moodycamel::BlockingReaderWriterQueue< std::vector<uint8_t> > > vnetQueues;
void hidReadTask();
void vnetReadTask(size_t vnetIndex);
};