mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
common: fix mix of spaces & tabs
This commit is contained in:
parent
9502b54aa0
commit
23f1a253a7
32 changed files with 4323 additions and 4323 deletions
42
common/cmd.c
42
common/cmd.c
|
@ -32,33 +32,33 @@
|
|||
#include "cmd.h"
|
||||
|
||||
uint8_t cmd_send(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void* data, size_t len) {
|
||||
UsbCommand txcmd;
|
||||
UsbCommand txcmd;
|
||||
|
||||
for (size_t i=0; i < sizeof(UsbCommand); i++)
|
||||
((uint8_t*)&txcmd)[i] = 0x00;
|
||||
for (size_t i=0; i < sizeof(UsbCommand); i++)
|
||||
((uint8_t*)&txcmd)[i] = 0x00;
|
||||
|
||||
// Compose the outgoing command frame
|
||||
txcmd.cmd = cmd;
|
||||
txcmd.arg[0] = arg0;
|
||||
txcmd.arg[1] = arg1;
|
||||
txcmd.arg[2] = arg2;
|
||||
// Compose the outgoing command frame
|
||||
txcmd.cmd = cmd;
|
||||
txcmd.arg[0] = arg0;
|
||||
txcmd.arg[1] = arg1;
|
||||
txcmd.arg[2] = arg2;
|
||||
|
||||
// Add the (optional) content to the frame, with a maximum size of USB_CMD_DATA_SIZE
|
||||
if (data && len) {
|
||||
len = MIN(len, USB_CMD_DATA_SIZE);
|
||||
for (size_t i=0; i<len; i++) {
|
||||
txcmd.d.asBytes[i] = ((uint8_t*)data)[i];
|
||||
}
|
||||
}
|
||||
// Add the (optional) content to the frame, with a maximum size of USB_CMD_DATA_SIZE
|
||||
if (data && len) {
|
||||
len = MIN(len, USB_CMD_DATA_SIZE);
|
||||
for (size_t i=0; i<len; i++) {
|
||||
txcmd.d.asBytes[i] = ((uint8_t*)data)[i];
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t sendlen = 0;
|
||||
// Send frame and make sure all bytes are transmitted
|
||||
sendlen = usb_write( (uint8_t*)&txcmd, sizeof(UsbCommand) );
|
||||
uint32_t sendlen = 0;
|
||||
// Send frame and make sure all bytes are transmitted
|
||||
sendlen = usb_write( (uint8_t*)&txcmd, sizeof(UsbCommand) );
|
||||
|
||||
#ifdef WITH_FPC
|
||||
// usart_init();
|
||||
// usart_writebuffer( (uint8_t*)&txcmd, sizeof(UsbCommand) );
|
||||
// usart_init();
|
||||
// usart_writebuffer( (uint8_t*)&txcmd, sizeof(UsbCommand) );
|
||||
#endif
|
||||
|
||||
return sendlen;
|
||||
return sendlen;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue