Curious, with this code:
uint8_t* buf; uint32_t sum = *buf++ << 8;
Even with this code:
uint8_t* buf; sum = ((uint8_t)*buf++) << ((uint8_t)0x08);
if buff == 0xC0 shouldnt sum be 0x0000C000 the result I get is 0xFFFFC000, I have to do this to fix it:
uint32_t sum = (uint32_t)*buf++ << 8;
But why is it sign extending what should be an unsigned number?