Quote:
|
Originally Posted by Mark McLeod
I took a quick look and repeated your problem.
It doesn't seem to have anything to do with the CMD_WAIT, because it happens with all NULL cmds as well. Oddly enough, it only happened for me when the number of commands equaled 6 or 7. More or fewer commands didn't have a problem. That's probably because the number of cmds determines the location where the array gets allocated. A quick solution is to pad with NULL cmds as a work around to go on with your testing until the problem is solved.
I'll take a look at the corresponding memory map for the problem and see if there's a space allocation issue or memory overwrite from the variables before it.
Found it. Your problem is line 15 of robot.c
A printf cannot have a format string of more than 80 characters (between the quotes). What's happening is the print buffer is overwriting memory locations that follow it. Depending on how many commands you have in command_list (the length of the array in other words) the linker will fit it in to the most convenient available space. Sometimes this falls after the print buffer. Several other variables are being overwritten as well, you just didn't happen to notice.
|
Wow! Thank you so much ... I would have probably commited suicide at some point because changing the line 15 would have really been the last thing I would have concidered ...! Thank you! Thank you! Thank you! That made my day!
And regarding prinft: Is it 80 chars / cycle max or 80 chars / fct call max? Just so I know which limit I got. After that I'll write an Error Handler in the printf class when the string exceeds the 80 sign max ...
And one more time, thx!!
Felix