This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Alternate method of using "sfr" and "sbit" for Misra Compliance

I want to change my code along with Compiler library header files to have Misra-C Compliance.

For the following code, there is an Misra Violation saying that
"There shall be no definitions of objects or functions in a header file".
sfr P0 = 0x80;
sbit P0_7 = P0^7;

And " ANSI C error: 'expression must have a constant value' " for
sbit P0_7 = P0^7;

Please suggest an alternate method for implementing the above code?

Thank you.

0