if ( len % 16 == 0 ) {
for(; p-buf < len; p += 16)
- Dbprintf("[%s:%02x/%02x] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
+ Dbprintf("[%s:%d/%d] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
name,
p-buf,
len,
}
else {
for(; p-buf < len; p += 8)
- Dbprintf("[%s:%02x/%02x] %02x %02x %02x %02x %02x %02x %02x %02x", name, p-buf, len, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
+ Dbprintf("[%s:%d/%d] %02x %02x %02x %02x %02x %02x %02x %02x", name, p-buf, len, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
}
}
return (data[2] << 16) | (data[1] << 8) | data[0];
}
+//added here for parity calulations
+uint8_t oddparity(uint8_t bt)
+{
+ uint16_t v = bt;
+ v ^= v >> 4;
+ v &= 0xF;
+ return ((0x9669 >> v) & 1);
+}
+
void LEDsoff()
{
LED_A_OFF();
{
struct version_information *v = (struct version_information*)version_information;
dst[0] = 0;
- strncat(dst, prefix, len);
+ strncat(dst, prefix, len-1);
if(v->magic != VERSION_INFORMATION_MAGIC) {
strncat(dst, "Missing/Invalid version information", len - strlen(dst) - 1);
return;