baudrate only for physical uart

This commit is contained in:
Philippe Teuwen 2019-04-28 22:51:40 +02:00
parent cf0d17853e
commit 5bc9118a19
3 changed files with 11 additions and 16 deletions

View file

@ -259,7 +259,7 @@ static void show_help(bool showFullHelp, char *exec_name) {
PrintAndLogEx(NORMAL, " -t/--text dump all interactive command's help at once");
PrintAndLogEx(NORMAL, " -m/--markdown dump all interactive help at once in markdown syntax");
PrintAndLogEx(NORMAL, " -p/--port serial port to connect to");
PrintAndLogEx(NORMAL, " -b/--baud serial port speed");
PrintAndLogEx(NORMAL, " -b/--baud serial port speed (only needed for physical UART, not for USB-CDC or BT)");
PrintAndLogEx(NORMAL, " -w/--wait 20sec waiting the serial port to appear in the OS");
PrintAndLogEx(NORMAL, " -f/--flush output will be flushed after every print");
PrintAndLogEx(NORMAL, " -c/--command <command> execute one proxmark3 command (or several separated by ';').");
@ -433,15 +433,9 @@ int main(int argc, char *argv[]) {
if (!script_cmds_file && !stdinOnPipe)
showBanner();
// default speed for USB 460800, USART(FPC serial) 115200 baud
// Let's take a baudrate ok for real UART, USB-CDC & BT don't use that info anyway
if (speed == 0)
#ifdef WITH_FPC_HOST
// Let's assume we're talking by default to pm3 over usart in this mode
speed = USART_BAUD_RATE;
#else
speed = 460800;
#endif
if (script_cmd) {
while (script_cmd[strlen(script_cmd) - 1] == ' ')

View file

@ -420,7 +420,7 @@ const char *getStringDescriptor(uint8_t idx) {
reg |= REG_NO_EFFECT_1_ALL; \
reg &= ~(flags); \
pUdp->UDP_CSR[(endpoint)] = reg; \
} \
}
// reset flags in the UDP_CSR register and waits for synchronization
#define UDP_SET_EP_FLAGS(endpoint, flags) { \
@ -429,7 +429,7 @@ const char *getStringDescriptor(uint8_t idx) {
reg |= REG_NO_EFFECT_1_ALL; \
reg |= (flags); \
pUdp->UDP_CSR[(endpoint)] = reg; \
} \
}
typedef struct {
@ -439,12 +439,12 @@ typedef struct {
uint8_t DataBits;
} AT91S_CDC_LINE_CODING, *AT91PS_CDC_LINE_CODING;
AT91S_CDC_LINE_CODING line = {
115200, // baudrate
0, // 1 Stop Bit
0, // None Parity
8
}; // 8 Data bits
AT91S_CDC_LINE_CODING line = { // purely informative, actual values don't matter
USART_BAUD_RATE, // baudrate
0, // 1 Stop Bit
0, // None Parity
8 // 8 Data bits
};
static void SpinDelay(int ms) {
int us = ms * 1000;

View file

@ -37,6 +37,7 @@
#include <wchar.h>
#include "at91sam7s512.h"
#include "usart.h"
#include "config_gpio.h"
#include "proxmark3.h" // USB_CONNECT()
#include "common.h"