Re: Question about AutoStarting Tasks
Wow, this topic really sparked alot of interest.
Okay since nobody bit on this I did a little more investigation and after a million recompiles I managed to get a small sample code that demonstrates the problem. And should provide the developers enough insight to find the problem pretty easily...fixing it might be easy or hard depending on where the bug actually is.
Basically, the problem is that once a macro() is invoked by the preprocessor, the #pragma autoStartTasks is locked in for all sources in the project. Yes it really is that insane (which is why it took me a while to figure out). Here's a test/proof.
File #1: test.c
File #2: testfoo.c
And for those who don't want to bother typing this code in, here's the interesting part of the results...
//Code segment: main(); Task: 0
0000: XX180000000000000000 defineMUXes(none, none, none, none, none, none, none, none, none, none, none, none, none, none, none, none)
0012: XX01 StartTask(autoStartMeTask)
0014: XX02 StartTask(dontStartMeTask)
0016: XX81 L0016: BranchNear(L0016) // Jump to end Expression
*Warning*:Possible programming error. Infinite loop (unconditional branch to itself) detected.
That line in red should definitely
not be there, and in fact if you comment out the macro call it will go away.
If this was open source I'd post a patch instead complaining, but since its not... this is as close to a solution as I can give you.
Happy bug stomping.