From 19438ccbebd4513b552faf12728c412689f6d854 Mon Sep 17 00:00:00 2001
From: Rodrigo L. Rosa <rodrigorosa.LG@gmail.com>
Date: Wed, 29 Jun 2011 13:44:20 -0700
Subject: [PATCH 4/4] fix write error

messed something up a couple commits ago, now it's working again (shifting in the wrong direction when building 16bit data from two 8bit)
---
 src/target/dsp5680xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 08750d2..ca523e8 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -821,7 +821,7 @@ static int dsp5680xx_write_8(struct target * target, uint32_t address, uint32_t
       dsp5680xx_context.flush = 1;
       counter = FLUSH_COUNT_READ_WRITE;
     }
-    data_16=(((data[2*iter]>>8)&0xff)|((data[2*iter+1])&0xff));
+    data_16=(data[2*iter]|(data[2*iter+1]<<8));
     retval = dsp5680xx_write_16_single(target,address+iter,data_16, pmem);
     if(retval != ERROR_OK){
       LOG_ERROR("%s: Could not write to p:0x%04X",__FUNCTION__,address);
-- 
1.7.0.4

