mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fix: whitespaces
This commit is contained in:
parent
00d1fd9d45
commit
44392c6afc
1 changed files with 279 additions and 280 deletions
|
@ -70,11 +70,10 @@ typedef struct {
|
||||||
// Set time-out on 30 miliseconds
|
// Set time-out on 30 miliseconds
|
||||||
struct timeval timeout = {
|
struct timeval timeout = {
|
||||||
.tv_sec = 0, // 0 second
|
.tv_sec = 0, // 0 second
|
||||||
.tv_usec = 30000 // 30000 micro seconds
|
.tv_usec = 30000 // 30 000 micro seconds
|
||||||
};
|
};
|
||||||
|
|
||||||
serial_port uart_open(const char* pcPortName)
|
serial_port uart_open(const char* pcPortName) {
|
||||||
{
|
|
||||||
serial_port_unix* sp = calloc(sizeof(serial_port_unix), sizeof(uint8_t));
|
serial_port_unix* sp = calloc(sizeof(serial_port_unix), sizeof(uint8_t));
|
||||||
if (sp == 0) return INVALID_SERIAL_PORT;
|
if (sp == 0) return INVALID_SERIAL_PORT;
|
||||||
|
|
||||||
|
@ -87,12 +86,10 @@ serial_port uart_open(const char* pcPortName)
|
||||||
return INVALID_SERIAL_PORT;
|
return INVALID_SERIAL_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeout.tv_usec = 300000 // 300 000 micro seconds
|
||||||
|
|
||||||
char *colon = strrchr(addrstr, ':');
|
char *colon = strrchr(addrstr, ':');
|
||||||
char *portstr;
|
char *portstr;
|
||||||
|
|
||||||
// Set time-out to 300 miliseconds only for TCP port
|
|
||||||
timeout.tv_usec = 300000;
|
|
||||||
|
|
||||||
if (colon) {
|
if (colon) {
|
||||||
portstr = colon + 1;
|
portstr = colon + 1;
|
||||||
*colon = '\0';
|
*colon = '\0';
|
||||||
|
@ -373,7 +370,10 @@ uint32_t uart_get_speed(const serial_port sp) {
|
||||||
struct termios ti;
|
struct termios ti;
|
||||||
uint32_t uiPortSpeed;
|
uint32_t uiPortSpeed;
|
||||||
const serial_port_unix* spu = (serial_port_unix*)sp;
|
const serial_port_unix* spu = (serial_port_unix*)sp;
|
||||||
if (tcgetattr(spu->fd, &ti) == -1) return 0;
|
|
||||||
|
if (tcgetattr(spu->fd, &ti) == -1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
// Set port speed (Input)
|
// Set port speed (Input)
|
||||||
speed_t stPortSpeed = cfgetispeed(&ti);
|
speed_t stPortSpeed = cfgetispeed(&ti);
|
||||||
switch (stPortSpeed) {
|
switch (stPortSpeed) {
|
||||||
|
@ -411,5 +411,4 @@ uint32_t uart_get_speed(const serial_port sp) {
|
||||||
};
|
};
|
||||||
return uiPortSpeed;
|
return uiPortSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue