|
@@ -98,11 +98,14 @@ int lpc_command(char *text, ...) {
|
|
int lpc_read_partid(struct lpc_device *dev) {
|
|
int lpc_read_partid(struct lpc_device *dev) {
|
|
int i;
|
|
int i;
|
|
int res;
|
|
int res;
|
|
- unsigned int partid;
|
|
|
|
|
|
+ int partid;
|
|
res = lpc_command("J\r\n");
|
|
res = lpc_command("J\r\n");
|
|
if(res!=0)
|
|
if(res!=0)
|
|
return res;
|
|
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++)
|
|
for(i=0; lpc_parts[i].name; i++)
|
|
if(lpc_parts[i].part_id==partid)
|
|
if(lpc_parts[i].part_id==partid)
|
|
break;
|
|
break;
|