}\r
\r
case CMD_DOWNLOADED_SIM_SAMPLES_125K: {\r
+ UsbCommand ack;\r
BYTE *b = (BYTE *)BigBuf;\r
memcpy(b+c->arg[0], c->d.asBytes, 48);\r
//Dbprintf("copied 48 bytes to %i",b+c->arg[0]);\r
+ ack.cmd = CMD_ACK;\r
+ UsbSendPacket((BYTE*)&ack, sizeof(ack));\r
break;\r
}\r
\r
/* convert to bitstream if necessary */\r
ChkBitstream(str);\r
\r
+ PrintToScrollback("Sending data, please wait...");\r
for (i = 0; i < GraphTraceLen; i += 48) {\r
UsbCommand c={CMD_DOWNLOADED_SIM_SAMPLES_125K, {i, 0, 0}};\r
int j;\r
c.d.asBytes[j] = GraphBuffer[i+j];\r
}\r
SendCommand(&c);\r
+ wait_for_response(CMD_ACK);\r
}\r
\r
+ PrintToScrollback("Starting simulator...");\r
UsbCommand c={CMD_SIMULATE_TAG_125K, {GraphTraceLen, gap, 0}};\r
SendCommand(&c);\r
}\r
/* Maybe it's a response: */\r
switch(current_command) {\r
case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K:\r
- if (c->cmd != CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K) goto unexpected_response;\r
- int i;\r
- for(i=0; i<48; i++) sample_buf[i] = c->d.asBytes[i];\r
- received_command = c->cmd;\r
- return;\r
- default:\r
- unexpected_response:\r
- PrintToScrollback("unrecognized command %08x\n", c->cmd);\r
- break;\r
+ if (c->cmd != CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K) goto unexpected_response;\r
+ int i;\r
+ for(i=0; i<48; i++) sample_buf[i] = c->d.asBytes[i];\r
+ received_command = c->cmd;\r
+ return;\r
+ case CMD_DOWNLOADED_SIM_SAMPLES_125K:\r
+ if (c->cmd != CMD_ACK) goto unexpected_response;\r
+ // got ACK\r
+ received_command = c->cmd;\r
+ return;\r
+ default:\r
+ unexpected_response:\r
+ PrintToScrollback("unrecognized command %08x\n", c->cmd);\r
+ break;\r
}\r
}\r