Skip to content

Commit

Permalink
fixed: print debug output from CSerialPort with two char hex
Browse files Browse the repository at this point in the history
  • Loading branch information
bob.loosen committed Dec 30, 2010
1 parent c5ddf6a commit 0b4278c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion boblight.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ color red ambilight1 1
color green ambilight1 2
color blue ambilight1 3
hscan 0 100
vscan 0 100
vscan 0 100
4 changes: 2 additions & 2 deletions src/util/serialport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int CSerialPort::Write(unsigned char* data, int len)
{
printf("%s write:", m_name.c_str());
for (int i = 0; i < byteswritten; i++)
printf(" %x", (unsigned int)data[i]);
printf(" %02x", (unsigned int)data[i]);

printf("\n");
}
Expand Down Expand Up @@ -150,7 +150,7 @@ int CSerialPort::Read(unsigned char* data, int len, int64_t usecs /*= -1*/)
{
printf("%s read:", m_name.c_str());
for (int i = 0; i < bytesread; i++)
printf(" %x", (unsigned int)data[i]);
printf(" %02x", (unsigned int)data[i]);

printf("\n");
}
Expand Down

0 comments on commit 0b4278c

Please sign in to comment.