In using the above with CCS I am noticing some strange things with the shift operator. I expected that if I shifted left OR right that '0' would be shifted in but I am seeing that if I shift right '1' is shifted in and if I shift left '0' is shifted in.....Is this the way shift works?
Ex. a uint8_t variable
0xE1 >> 4
0xFFFE
I was hoping for 0x0E......
I am finding I have to typecast and do something like
(uint8_t(variable >> 4) & 0xF))
Is this correct or am I missing something?
Thanks
I am adding a follow up here....I am inverting my variable first as ~variable.....Seems that doing a bitwise negation on a uint8_t creates a signed int....Can someone tell me why a signed uint8_t isn't created?