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

different notation

Hello guys,

just a silly question,
is it possible to modify code to a different notation:

//**************************************************************************
void SPI_send_8(unsigned int a)
{
        SPITX = a;
        while(!(SPISTA & 0x04)){}
}
//**************************************************************************

to:

//**************************************************************************
void SPI_send_8(unsigned int SPITX)
{
        while(!(SPISTA & 0x04)){}
}
//**************************************************************************


SPITX is the SPI TX.

Parents
  • void SPI_send_8(unsigned int SPITX)
    

    will likely have space on the stack utilized for the SPITX parameter. so this is not the same as the original expression which addresses the global. your piece of code will hide the global memory mapped variable SPITX and replace it this the stack/register allocated one, having no effect on the peripheral.

Reply
  • void SPI_send_8(unsigned int SPITX)
    

    will likely have space on the stack utilized for the SPITX parameter. so this is not the same as the original expression which addresses the global. your piece of code will hide the global memory mapped variable SPITX and replace it this the stack/register allocated one, having no effect on the peripheral.

Children
No data