+ /* This conversion comes from the openhantek project.
+ * Each set bit in the 24-bit value inverts all bits with a lower
+ * value. No idea why the device reports the trigger point this way.
+ */
+ bitvalue = 1;
+ for (i = 0; i < 24; i++) {
+ /* Each set bit inverts all bits with a lower value. */
+ if(toff & bitvalue)
+ toff ^= bitvalue - 1;
+ bitvalue <<= 1;
+ }
+ *trigger_offset = toff;
+
+ return SR_OK;