+
+ /* This function is called about every 50ms.
+ * To avoid filling the log file with redundant information during long captures,
+ * just print a log message if status has changed.
+ */
+
+ if(state != previous_state) {
+ previous_state = state;
+ if((state & 0x0003)==1) {
+ sr_dbg("run_state: 0x%04x (%s)", state, "idle");
+ }
+ else if((state & 0x000f)==2) {
+ sr_dbg("run_state: 0x%04x (%s)", state, "pre-trigger sampling");
+ }
+ else if((state & 0x000f)==0x0a) {
+ sr_dbg("run_state: 0x%04x (%s)", state, "sampling, waiting for trigger");
+ }
+ else if((state & 0x000f)==0x0e) {
+ sr_dbg("run_state: 0x%04x (%s)", state, "post-trigger sampling");
+ }
+ else {
+ sr_dbg("run_state: 0x%04x", state);
+ }
+ }