Browse Source

Decimal system, debug lines

Added some debug lines
Mateusz Bugdalski 13 years ago
parent
commit
9ce1ac7550
1 changed files with 5 additions and 2 deletions
  1. 5 2
      lpc.c

+ 5 - 2
lpc.c

@@ -98,11 +98,14 @@ int lpc_command(char *text, ...) {
 int lpc_read_partid(struct lpc_device *dev) {
   int i;
   int res;
-  unsigned int partid;
+  int partid;
   res = lpc_command("J\r\n");
   if(res!=0)
     return res;
-  scanf("0x%x\r\n", &partid);
+  if(scanf("%d\r\n", &partid)<1)
+    sprog_error("Unable to read part ID\n");
+  else 
+    sprog_error("Received part ID: %d (0x%08x)\n", partid, partid);
   for(i=0; lpc_parts[i].name; i++)
     if(lpc_parts[i].part_id==partid)
       break;