The memcpy()
function expects two pointers, but InterruptLatency
is an 8-bit integer.
The solution is to take the address of the variable:
memcpy(buf, &InterruptLatency, sizeof InterruptLatency);
^
|
address-of
operator
Note that no parentheses are needed for sizeof
when taking the size of an actual object. This is because sizeof
is not a function.
Also note that using memcpy()
for copying a single byte into a byte array like this would never happen in "real" C code. I'd just do:
buf[0] = InterruptLatency;