X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fchronovu-la%2Fprotocol.c;h=5b4723c2db87ad40eaf267cd5ae27334380f6bdb;hb=f897acaee82d5bc3c511da14167fbbd7951cbf3d;hp=28ac15bee0853f2e3f581ff4caf89b374914f324;hpb=7b3567126c22622180d82463f4f848606d52d2cd;p=libsigrok.git diff --git a/hardware/chronovu-la/protocol.c b/hardware/chronovu-la/protocol.c index 28ac15be..5b4723c2 100644 --- a/hardware/chronovu-la/protocol.c +++ b/hardware/chronovu-la/protocol.c @@ -417,8 +417,8 @@ SR_PRIV int cv_read_block(struct dev_context *devc) SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) { - int i; - uint8_t sample, expected_sample; + int i, idx; + uint8_t sample, expected_sample, tmp8; struct sr_datafeed_packet packet; struct sr_datafeed_logic logic; int trigger_point; /* Relative trigger point (in this block). */ @@ -452,6 +452,16 @@ SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) } } + /* Swap low and high bytes of the 16-bit LA16 samples. */ + if (devc->prof->model == CHRONOVU_LA16) { + for (i = 0; i < BS; i += 2) { + idx = (block * BS) + i; + tmp8 = devc->final_buf[idx]; + devc->final_buf[idx] = devc->final_buf[idx + 1]; + devc->final_buf[idx + 1] = tmp8; + } + } + /* If no trigger was found, send one SR_DF_LOGIC packet. */ if (trigger_point == -1) { /* Send an SR_DF_LOGIC packet to the session bus. */