asix-sigma: Properly fetch timestamp in decode_chunk_ts()

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 <marex@denx.de>
This commit is contained in:
Marek Vasut 2014-04-20 22:45:25 +02:00 committed by Bert Vermeulen
parent f41a4cae49
commit 3628074d09
1 changed files with 4 additions and 2 deletions

View File

@ -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;