rtel wrote on Sunday, December 02, 2007:
So this is quite a different port then. I cannot go through your code or datasheet as this will take a couple of days (I can send you a quote for the work if you like :o), but below are my suggestions for testing the new port.
I would suggest writing a task that fills the registers with known values (using inline asm), then calls taskYIELD(), then checks that all the registers still contain their known values (again using inline asm) - the registers should not have been altered across the call to taskYIELD(). Run this task with configUSE_PREEMPTION set to 0.
Once you have a single task running this way, create another task that does the same thing, but fills the registers with different values and run both tasks at once. When both tasks are running you should have something like this:
1) Task A fills registers with known values and yields to task 2.
2) During the yield the Task A values are stored to the Task A context.
3) Task B runns and fills registers with different values, overwriting those filled by Task A.
4) Task B yields back to Task A.
5) During the yield, that Task B values are saved to the Task B context, and the Task A values are restored from the Task A context back into the registers.
6) Task A checks the registers hold the values it expects, flagging an error if not.
7) etc. etc.
Once you have both tasks running correct in this cooperative way, take out the call to task taskYIELD() and set the configUSE_PREEMPTION to 1, and check no errors are found when running preemptively.