using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace Tango.Scripting.IDE.Projects
{
public class StubProject : CSharpProject
{
public override BitmapSource Image => GetImage("Images/StubProject.png");
public override Task Build()
{
throw new NotImplementedException();
}
public override Task Run()
{
throw new NotImplementedException();
}
}
}
+ //for(i=0;i<0x3FFFFF;i++)
+// {
+// Run(FWD,i );
+// HardStop();
+// writeLine("Tx ");
+// writeFloat(i);
+// SysCtlDelay(5000000);
+// }
+ //i = 100000;
+
+ unsigned long Read_Speed,
+ //Read_MaxSpeed,
+ //Read_Acc,
+ //Read_Dec,
+ //speed,
+ Read_pos,
+ //Pos_Value,
+ //Read_ELpos,
+ read_status;
+ //unsigned long SpeedStepPerSec,
+ // MaxSpeedStepPerSec;
+
+ //Direction = FWD;
+ //Run_Value = 0x10625; // 1000 step/sec
+ //Pos_Value = 0x111111; // 1000 step/sec
+ unsigned k = 1;
+
+ //SetParam(x_MAX_SPEED, MaxSpdCalc(1100)); // >1000 step/sec
+ //SetParam(x_MAX_SPEED, 0x10680); // >1000 step/sec
+
+ while(k)
+ {
+
+ while(SSIBusy(SSI2_BASE)){};
+ //Avi_test_get_speed(); //OK !!!
+ Read_Speed = Get_Param(x_SPEED);
+/* writeLine("Read_Speed: ");
+ writeFloat(Read_Speed);*/
+
+ while(SSIBusy(SSI2_BASE)){};
+ //SysCtlDelay(17500000);
+ Read_pos = Get_Param(x_ABS_POS);
+ //writeLine("Read_pos: ");
+ //writeFloat(Read_pos);
+ while(SSIBusy(SSI2_BASE)){};
+
+/* Read_ELpos = Get_Param(x_EL_POS);
+ writeLine("Read_EL_pos: ");
+ writeFloat(Read_ELpos);
+ while(SSIBusy(SSI2_BASE)){};*/
+
+
+ //writeLine("Tx ");
+ //writeFloat(Run_Value);
+ Run(Direction,Run_Value );
+
+ switch(Stop_Command)
+ {
+ case 1:
+ HardStop();
+ break;
+ case 2:
+ SoftStop();
+ break;
+ case 3:
+ HardHiZ();
+ break;
+ case 4:
+ SoftHiZ();
+ break;
+ default:
+ break;
+ }
+
+/* if(k>5)
+ Move(Direction,Pos_Value );
+ else
+ //GoTo_DIR(Direction,Pos_Value );
+ GoTo(Pos_Value );*/
+
+ read_status = Get_Param(x_STATUS);
+/*
+ switch((read_status & x_STATUS_MOT_STATUS)>>5)
+ {
+ case 0://Stopped
+ writeLine("-");
+ break;
+ case 1://Acceleration
+ if(read_status & x_STATUS_DIR)
+ writeLine(">>>");
+ else
+ writeLine("<<<");
+ break;
+ case 2://Deceleration
+ if(read_status & x_STATUS_DIR)
+ writeLine(">");
+ else
+ writeLine("<");
+ break;
+ case 3://Constant speed
+ if(read_status & x_STATUS_DIR)
+ //writeLine(">>");
+ else
+ writeLine("<<");
+ break;
+ }
+ */
+ //read_status = GetStatus();
+ //read_status = Get_Param_Status( x_GET_STATUS); // The GetStatus command resets the STATUS register warning flags.
+ read_status = Get_and_Clear_Status();
+
+ if((read_status & x_STATUS_UVLO)==0)
+ //writeLine("Undervoltage");
+
+ Get_Param(x_STEP_MODE);
+
+ /*
+ //speed = Get_Param(x_SPEED);
+ speed = GetParam(x_SPEED);
+ if(speed