I have a project that uses an uint24_t or unsigned short long (as MPLABX calls it) and I was getting some strange behavior.
I did a simple test to check this with the following code,
I assumed temp would contain 0xfffc but it appears that the upper byte has also been set to 0xff.
I get this warning which I assume has something to do with it,
But I don't understand this warning.
I can fix the error by using a cast, temp=(uint24_t)0x3fff<<2;
However, I'm trying to understand what is happening. Note the variable is set to zero at startup.
Thanks,
Mike.
I did a simple test to check this with the following code,
I assumed temp would contain 0xfffc but it appears that the upper byte has also been set to 0xff.
I get this warning which I assume has something to do with it,
But I don't understand this warning.
I can fix the error by using a cast, temp=(uint24_t)0x3fff<<2;
However, I'm trying to understand what is happening. Note the variable is set to zero at startup.
Thanks,
Mike.