Hello,
When the following code executes, (LP3500 with WA Kit), it parses the serial port for data (i check for a simple message format), and based on a valid message,the code calls a function DO_Command.
The RUB:
What is interesting is, if i remove the printf(“.”) after the serCgetC(), the code does not work. It is almost like the serial task / interrupt is not running?
Please help,
…
…
…
// Set execute
execute = RUN;
// Main loop
while (execute == RUN) {
// [R2] - [read_rtc] - [PG 331]
rtc_time = read_rtc();
// Has time out occured?
if (rtc_time < _rtc_timeout) {
serData232 = serCgetc();
printf(“.”);
// Is valid data available?
if (serData232 != -1) {
// Is start byte present?
if (serData232 == _MSG_START){
// Read 3 Bytes?
if (serCread(serBuffer232,3,200)== 3) {
// Is atop byte present?
if ((serBuffer232[2] == _MSG_STOP)) {
// Parse well formed message
status = DO_Command(serBuffer232[0], serBuffer232[1]);
}
}
}
}
}
else {
// Timeout occured, stop main loop
execute = STOP;
}
}
DO_Kill();
}