|
Message
From: cvs at opencores.org<cvs@o...>
Date: Mon Oct 30 18:54:52 CET 2006
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/06/10 30:18:54 Modified: jop/java/target/src/app/tal Config.java Log: len and CONIG_LEN is in words, clearBuffer() Revision Changes Path 1.2 jop/java/target/src/app/tal/Config.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/tal/Config.java.diff?r1=1.1&r2=1.2 (In the diff below, changes in quantity of whitespace are not shown.) Index: Config.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/app/tal/Config.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- Config.java 11 May 2005 17:37:20 -0000 1.1 +++ Config.java 30 Oct 2006 17:54:51 -0000 1.2 @@ -7,6 +7,7 @@ package tal; import util.Amd; +import util.Dbg; import com.jopdesign.sys.Native; @@ -67,16 +68,21 @@ } } + public void clearBuffer(int pos) { + + for (int i=pos; i<buf.length; ++i) { + setInt(i, 0); + } + } + public void setString(int pos, StringBuffer s) { if (len==0) read(); if (pos<0 || pos>16383) return; - int len = s.length(); - int slen = len; - if ((len&0x03)==0) ++len; + int slen = s.length(); // copy buffer int k = 0; - for (int i=0; i<len; i+=4) { + for (int i=0; i<slen+4; i+=4) { for (int j=0; j<4; ++j) { k <<= 8; if (i+j < slen) { @@ -103,7 +109,6 @@ private void read() { len = getInt(FlashConst.CONFIG_LEN); - len = (len+3)>>2; // count in words if (len<=0 || len>1000) len = 512; // some ? default for (int i=0; i<len; ++i) {
|
 |