]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hantek-dso/dso.c
sr: hantek-dso: Use portable g_ntohs() function.
[libsigrok.git] / hardware / hantek-dso / dso.c
index 1d59017970e7efc90f115a73c3c26740b8803ce8..73dd8eb31492369adf4e1303ab1bd3d18361c0fa 100644 (file)
@@ -26,7 +26,6 @@
 #include <string.h>
 #include <glib.h>
 #include <libusb.h>
-#include <arpa/inet.h>
 
 extern libusb_context *usb_context;
 extern GSList *dev_insts;
@@ -223,8 +222,8 @@ static int get_channel_offsets(struct context *ctx)
         */
        for (chan = 0; chan < 2; chan++) {
                for (v = 0; v < 9; v++) {
-                       ctx->channel_levels[chan][v][0] = ntohs(ctx->channel_levels[chan][v][0]);
-                       ctx->channel_levels[chan][v][1] = ntohs(ctx->channel_levels[chan][v][1]);
+                       ctx->channel_levels[chan][v][0] = g_ntohs(ctx->channel_levels[chan][v][0]);
+                       ctx->channel_levels[chan][v][1] = g_ntohs(ctx->channel_levels[chan][v][1]);
                }
        }
 
@@ -443,12 +442,12 @@ SR_PRIV int dso_set_voltage(struct context *ctx)
        case VDIV_2V:
        case VDIV_200MV:
        case VDIV_20MV:
-               cmdstring[2] |= 0x08;
+               cmdstring[2] |= 0x04;
                break;
        case VDIV_5V:
        case VDIV_500MV:
        case VDIV_50MV:
-               cmdstring[2] |= 0x04;
+               cmdstring[2] |= 0x08;
                break;
        }