From 660d967ec0ac79ea2a43946be4c056ef2d21ffc4 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 22 May 2022 13:29:45 -0400 Subject: bug fixes; dynamic time measure; sync sample drawing --- source/stmdsp/stmdsp.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'source/stmdsp/stmdsp.hpp') diff --git a/source/stmdsp/stmdsp.hpp b/source/stmdsp/stmdsp.hpp index e0fca90..efed8a3 100644 --- a/source/stmdsp/stmdsp.hpp +++ b/source/stmdsp/stmdsp.hpp @@ -63,12 +63,15 @@ namespace stmdsp */ enum class Error : char { None = 0, - BadParam, /* An invalid parameter was passed for a command. */ - BadParamSize, /* An invaild param. size was given for a command. */ - BadUserCodeLoad, /* Device failed to load the given algorithm. */ - BadUserCodeSize, /* The given algorithm is too large for the device. */ - NotIdle, /* An idle-only command was received while not Idle. */ - ConversionAborted /* A conversion was aborted due to a fault. */ + BadParam, /* An invalid parameter was passed for a command. */ + BadParamSize, /* An invaild param. size was given for a command. */ + BadUserCodeLoad, /* Device failed to load the given algorithm. */ + BadUserCodeSize, /* The given algorithm is too large for the device. */ + NotIdle, /* An idle-only command was received while not Idle. */ + ConversionAborted, /* A conversion was aborted due to a fault. */ + NotRunning, /* A running-only command was received while not Running. */ + + GUIDisconnect = 100 /* The GUI lost connection with the device. */ }; /** @@ -123,8 +126,8 @@ namespace stmdsp void continuous_start(); void continuous_stop(); - void continuous_start_measure(); - uint32_t continuous_start_get_measurement(); + void measurement_start(); + uint32_t measurement_read(); std::vector continuous_read(); std::vector continuous_read_input(); @@ -149,11 +152,13 @@ namespace stmdsp unsigned int m_sample_rate = 0; bool m_is_siggening = false; bool m_is_running = false; + bool m_disconnect_error_flag = false; std::mutex m_lock; bool try_command(std::basic_string data); bool try_read(std::basic_string cmd, uint8_t *dest, unsigned int dest_size); + void handle_disconnect(); }; } -- cgit v1.2.3