X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fmic-985xx%2Fprotocol.h;h=d4ad06d914b2d067055966584c385f37f238bb7d;hb=5e7e327ac8ef964a8b21d59bd208969f5c41ad28;hp=279cca5be79f3ed195a49d27b6f18a9226671907;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git
diff --git a/src/hardware/mic-985xx/protocol.h b/src/hardware/mic-985xx/protocol.h
index 279cca5b..d4ad06d9 100644
--- a/src/hardware/mic-985xx/protocol.h
+++ b/src/hardware/mic-985xx/protocol.h
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#ifndef LIBSIGROK_HARDWARE_MIC_985XX_PROTOCOL_H
@@ -25,23 +24,20 @@
#include
#include
#include
-#include "libsigrok.h"
+#include
#include "libsigrok-internal.h"
#define LOG_PREFIX "mic-985xx"
-/* Note: When adding entries here, don't forget to update MIC_DEV_COUNT. */
enum {
MIC_98581,
MIC_98583,
};
-#define MIC_DEV_COUNT 2
-
struct mic_dev_info {
- char *vendor;
- char *device;
- char *conn;
+ const char *vendor;
+ const char *device;
+ const char *conn;
uint32_t max_sample_points;
gboolean has_temperature;
gboolean has_humidity;
@@ -51,25 +47,13 @@ struct mic_dev_info {
int (*receive_data)(int, int, void *);
};
-extern SR_PRIV const struct mic_dev_info mic_devs[MIC_DEV_COUNT];
+extern SR_PRIV const struct mic_dev_info mic_devs[];
#define SERIAL_BUFSIZE 256
/** Private, per-device-instance driver context. */
struct dev_context {
- /** The current sampling limit (in number of samples). */
- uint64_t limit_samples;
-
- /** The current sampling limit (in ms). */
- uint64_t limit_msec;
-
- /** Opaque pointer passed in by the frontend. */
- void *cb_data;
-
- /** The current number of already received samples. */
- uint64_t num_samples;
-
- int64_t starttime;
+ struct sr_sw_limits limits;
uint8_t buf[SERIAL_BUFSIZE];
int bufoffset;