Champs,
My customer is reading back IFR via the follow function for diagnostic. But we are getting a warning. Anything need to be done to take care of this warning?

Thanks,
Brian
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Champs,
My customer is reading back IFR via the follow function for diagnostic. But we are getting a warning. Anything need to be done to take care of this warning?

Thanks,
Brian
Brian,
While the IFR will be stored in the AL register, believe you still need to inform the compiler that funIFR will take on this value(even if we know it does). Can you try something like the below for the funIFR() function:
__asm(" .def _funIFR\n"
" .global _funIFR\n"
"_funIFR:\n"
" PUSH IFR\n"
" POP AL\n"
" LRETR\n");
Best,
Matthew
My customer is reading back IFR via the follow function for diagnostic.
Section 6.5.2 The __cregister Keyword of TMS320C28x Optimizing C/C++ Compiler v21.6.0.LTS User’s Guide explains how IFR can be accessed via the __cregister keyword, and has the following example code:
extern cregister volatile unsigned int IFR;
extern cregister volatile unsigned int IER;
extern int x;
main()
{
IER = x;
IER |= 0x100;
printf("IER = %x\n", IER);
IFR &= 0x100;
IFR |= 0x100;
I.e. should be able to try the above rather than the funIFR function.
I haven't tested this.
Chester,
Thanks for bringing this up/showing this. I had been looking in Section 7.6 in the assembly intrinsics and surprised we didn't have what you've posted above so I went the brute force route.
I agree your method is cleaner, avoids any potential disruption of the C generated asm, and is proven!
Brian,
I'd recommend your customer use the method Chester pointed out.
Best,
Matthew