[Firebug-cvs] dave switch.c,1.1,1.2
Brought to you by:
doolin
From: <do...@us...> - 2003-11-19 01:36:54
|
Update of /cvsroot/firebug/dave In directory sc8-pr-cvs1:/tmp/cvs-serv25039/dave Modified Files: switch.c Log Message: more work on gps driver, still have a problem with the debugging output. Index: switch.c =================================================================== RCS file: /cvsroot/firebug/dave/switch.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** switch.c 15 Nov 2003 22:28:35 -0000 1.1 --- switch.c 19 Nov 2003 01:36:51 -0000 1.2 *************** *** 28,32 **** --- 28,51 ---- + uint8_t foo; + + void + bit_print_uchar(uint8_t value) { + int i; + uint8_t mask; + + mask = 1 << 7; + + for (i=1; i<=8; i++) { + putchar(((value & mask) == 0) ? '0' : '1'); + value <<= 1; + if (i % 4 == 0 && i != 8) { + putchar(' '); + } + } + + putchar('\n'); + } *************** *** 315,322 **** { int length = 0; /** Garbage value to get it to compile. */ char data[] = {"asdfsg"}; ! I2CSwitch1_readPacketDone(length, data); return 0; } --- 334,349 ---- { int length = 0; + + + /** Garbage value to get it to compile. */ char data[] = {"asdfsg"}; ! printf("8: %b\n",8); ! ! bit_print_uchar(128); ! ! I2CSwitch1_readPacketDone(length, data); return 0; + } |