Instead of this ad-hoc readout voodoo, use proper function to read
the timestemp. One which will not break even on big-endian machines.

Signed-off-by: Marek Vasut <[email protected]>
---
 hardware/asix-sigma/asix-sigma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c
index 8be458e..64ebcbb 100644
--- a/hardware/asix-sigma/asix-sigma.c
+++ b/hardware/asix-sigma/asix-sigma.c
@@ -952,6 +952,7 @@ static int decode_chunk_ts(struct sigma_dram_line 
*dram_line, uint16_t *lastts,
                           uint16_t limit_chunk, void *cb_data)
 {
        uint8_t *buf = (uint8_t *)dram_line;
+       struct sigma_dram_cluster *dram_cluster;
        struct sr_dev_inst *sdi = cb_data;
        struct dev_context *devc = sdi->priv;
        uint16_t tsdiff, ts;
@@ -978,8 +979,9 @@ static int decode_chunk_ts(struct sigma_dram_line 
*dram_line, uint16_t *lastts,
        }
 
        /* For each ts. */
-       for (i = 0; i < 64; ++i) {
-               ts = *(uint16_t *) &buf[i * 16];
+       for (i = 0; i < 64; i++) {
+               dram_cluster = &dram_line->cluster[i];
+               ts = sigma_dram_cluster_ts(dram_cluster);
                tsdiff = ts - *lastts;
                *lastts = ts;
 
-- 
1.8.5.3


------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to