CaffineCoder wrote:
i hate to disagree with a Guru but i am going to anyway...
Well, do we disagree after all? My statement was that for me the bug did not show up with the code I did show. To reproduce, create a project with the wizard for the XDP512, select C++, Large memory model and past the code in the previous mail into main.cpp.
With this setup, the code behaves properly. I was using the options "-CpuHCS12X -D__NO_FLOAT__ -Ml".
after taking all the callback funtions out of the class and making the callback var static it works perfectly,
Not sure I understand what you did. Did you make the field CB a static instance, keeping it a pointer to member, or did change the type of CB to a plain C function pointer taking an additional Foo argument?
Anyway, does not really matter (for me) as this is just a workaround for you to meet the deadline. In the end, we have to isolate and fix the bug and after this changes, the bug does not show up anymore.
so i still believe that there is a problem with class member function pointers.
Yes, it looks like. Did you file a service request? I would propose to do so and provide a complete compilable sample, including the mcp, the elf file which fails and a description so the support understands what is supposed to happen, and what does happen.
i did a test with other compilers and the operated perfectly with both sets of code member function pointers and global.
maybe you didnt experience the problem because of compiler settings differences?
Daniel