diff --git a/expert.html b/expert.html
index fee9d7e..4811964 100644
--- a/expert.html
+++ b/expert.html
@@ -75,6 +75,7 @@ function handleOnload() {
diff --git a/expertWires.js b/expertWires.js
index 4eec7dd..8d3acf0 100644
--- a/expertWires.js
+++ b/expertWires.js
@@ -57,7 +57,7 @@ var animateChipLayout = true;
var userCode=[];
var userResetLow;
var userResetHigh;
-var userSteps;
+var userSteps=1000;
var testprogram=[];
var testprogramAddress;
@@ -148,7 +148,7 @@ function setupParams(){
// run a test program, and optionally check against a golden checksum
if(name=="steps" && parseInt(value)!=NaN){
userSteps=parseInt(value);
- running=true;
+// running=true;
} else if(name=="checksum" && parseInt(value,16)!=NaN){
goldenChecksum=(0x100000000+parseInt(value,16)).toString(16).slice(-8);
} else {
diff --git a/macros.js b/macros.js
index 09460ce..bf2a7e5 100644
--- a/macros.js
+++ b/macros.js
@@ -52,12 +52,12 @@ function loadProgram(){
}
function go(){
- if(userSteps!=undefined){
- if(--userSteps==0){
- running=false;
- userSteps=undefined;
- }
- }
+// if(userSteps!=undefined){
+// if(--userSteps==0){
+// running=false;
+// userSteps=undefined;
+// }
+// }
if(running) {
step();
setTimeout(go, 0); // schedule the next poll
@@ -385,14 +385,30 @@ function chipStatus(){
selectCell(ab);
}
+function goFor(){
+ var n = userSteps;
+ estimatedHz1();
+ while(--n){
+ halfStep();
+ cycle++;
+ }
+ estimatedHz1();
+ chipStatus();
+}
+
var prevHzTimeStamp=0;
var prevHzCycleCount=0;
var prevHzEstimate1=1;
var prevHzEstimate2=1;
var HzSamplingRate=10;
+
function estimatedHz(){
if(cycle%HzSamplingRate!=3)
return prevHzEstimate1;
+ return estimatedHz1();
+}
+
+function estimatedHz1(){
var HzTimeStamp = now();
var HzEstimate = (cycle-prevHzCycleCount+.01)/(HzTimeStamp-prevHzTimeStamp+.01);
HzEstimate=HzEstimate*1000/2; // convert from phases per millisecond to Hz