// is the order in which they go out on the wire.\r
//=============================================================================\r
\r
-BYTE ToSend[256];\r
+BYTE ToSend[512];\r
int ToSendMax;\r
static int ToSendBit;\r
struct common_area common_area __attribute__((section(".commonarea")));\r
void BufferClear(void)\r
{\r
memset(BigBuf,0,sizeof(BigBuf));\r
- DbpString("Buffer cleared");\r
+ Dbprintf("Buffer cleared (%i bytes)",sizeof(BigBuf));\r
}\r
\r
void ToSendReset(void)\r
UsbCommand c;\r
c.cmd = CMD_DEBUG_PRINT_STRING;\r
c.arg[0] = strlen(str);\r
+ if(c.arg[0] > sizeof(c.d.asBytes)) {\r
+ c.arg[0] = sizeof(c.d.asBytes);\r
+ }\r
memcpy(c.d.asBytes, str, c.arg[0]);\r
\r
UsbSendPacket((BYTE *)&c, sizeof(c));\r
{\r
int vHf = 0; // in mV\r
\r
- DbpString("Measuring HF antenna characteristics, press button to exit");\r
+ DbpString("Measuring HF antenna, press button to exit");\r
\r
for (;;) {\r
// Let the FPGA drive the high-frequency antenna around 13.56 MHz.\r
\r
void ReadMem(int addr)\r
{\r
- const DWORD *data = ((DWORD *)addr);\r
+ const BYTE *data = ((BYTE *)addr);\r
\r
Dbprintf("%x: %02x %02x %02x %02x %02x %02x %02x %02x",\r
addr, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);\r
}\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
#ifdef WITH_LF\r
case CMD_SIMULATE_TAG_125K:\r
LED_A_ON();\r
- SimulateTagLowFrequency(c->arg[0], 1);\r
+ SimulateTagLowFrequency(c->arg[0], c->arg[1], 1);\r
LED_A_OFF();\r
break;\r
#endif\r
}\r
break;\r
default:\r
- DbpString("unknown command");\r
+ Dbprintf("%s: 0x%04x","unknown command:",c->cmd);\r
break;\r
}\r
}\r