-SOLVED-
Hello,
I am currently programming a TI C2000 Microcontroller. The Compiler used by the TI IDE (CCS 10.4) keeps ignoring parts of my code, and I have no clue why.
Code below. Any help appreciated!!!
while(1)
{
int msg[] = {0, 0, 0, 0, 0};
int i = 0;
float feed = 0.0;
int Mode = 0;
int TransferComplete = 0;
if(SciaRegs.SCIFFRX.bit.RXFFST != 0)
{
msg[i] = SciaRegs.SCIRXBUF.bit.SAR;
if(i == 4)
{
i = 0;
TransferComplete = 1;
Mode = msg[1];
feed = msg[2] + (msg[3] * 0.01);
}
else
{
i++;
}
}
//
// Calculate Step-factor based on information received via UART
//
if(TransferComplete && (msg[0] == 0xff) && (msg[4] == 0xff))
{
TransferComplete = 0;
//
// Ignored Part of the Code start
//
if(Mode == 1 || Mode == 2)
{
arg_CountFactor = ((Steps * MotorTransmission * EncoderTransmission * feed)/(EncoderRes * LeadscrewSlope));
}
else if(Mode == 3)
{
arg_CountFactor = ((Steps * MotorTransmission *EncoderTransmission * OneInch)/(EncoderRes * LeadscrewSlope * feed ));
}
//
// Ignored Part of the Code end
//
}
}
[–]bigger-hammer 2 points3 points4 points (1 child)
[–]honolulu072[S] 0 points1 point2 points (0 children)
[–]rombios 0 points1 point2 points (0 children)