]> sigrok.org Git - libsigrok.git/commitdiff
scanalogic2: Only print actual state changes in the log.
authorUwe Hermann <redacted>
Tue, 11 Jun 2013 16:55:47 +0000 (18:55 +0200)
committerUwe Hermann <redacted>
Tue, 11 Jun 2013 16:39:55 +0000 (18:39 +0200)
hardware/ikalogic-scanalogic2/protocol.c

index d1fb3beb763ebee85424368f75512d2527e8310e..4ed690b6969a219ba89b3698e8e6ce39f563f194 100644 (file)
@@ -292,7 +292,9 @@ SR_PRIV void sl2_receive_transfer_in( struct libusb_transfer *transfer)
                return;
        }
 
-       sr_spew("State changed from %i to %i.", devc->state, devc->next_state);
+       if (devc->state != devc->next_state)
+               sr_spew("State changed from %i to %i.",
+                       devc->state, devc->next_state);
        devc->state = devc->next_state;
 
        if (devc->state == STATE_WAIT_DATA_READY) {
@@ -421,7 +423,9 @@ SR_PRIV void sl2_receive_transfer_out( struct libusb_transfer *transfer)
                return;
        }
 
-       sr_spew("State changed from %i to %i.", devc->state, devc->next_state);
+       if (devc->state != devc->next_state)
+               sr_spew("State changed from %i to %i.",
+                       devc->state, devc->next_state);
        devc->state = devc->next_state;
 
        if (devc->state == STATE_IDLE) {