samd: convert_tdio command cleaned up

This commit is contained in:
Ryan 2018-09-28 14:54:31 -07:00
parent 4aee9fe2a3
commit 84b6818982
2 changed files with 3 additions and 21 deletions

View File

@ -316,14 +316,9 @@ static bool cmd_convert_tdio(target *t, int argc, const char **argv)
{
(void)t;
(void) argc;
(void) argv;
uint32_t res = 0;
if (argc > 1)
res = usbuart_convert_tdio(atoi(argv[1]));
else
res = usbuart_convert_tdio(0);
gdb_outf("BAUD: %d\n", res);
usbuart_convert_tdio(0);
return true;
}

View File

@ -88,7 +88,7 @@ void usbuart_init(void)
//usart_enable(USART_NUM, current_baud);
usart_setup(USART_NUM, current_baud);
#ifndef DEBUG_ME
usart_set_pads(USART_NUM, 3, 0); /* uses different pads than the default */
usart_set_pads(USART_NUM, 3, 0); /* bm-sam uses different pads */
#endif
usart_enable(USART_NUM, 0); /* baud==0 so setup is skipped */
@ -98,7 +98,6 @@ void usbuart_init(void)
int usbuart_convert_tdio(uint32_t arg)
{
#if 1
(void) arg;
@ -130,18 +129,6 @@ int usbuart_convert_tdio(uint32_t arg)
return current_baud;
/* FOR TESTING PURPOSES ONLY */
#else
if (arg){
usart_disable(USART_NUM);
usart_set_baudrate(USART_NUM, arg);
usart_enable(USART_NUM, 0);
current_baud = arg;
} else
usart_send(0, 65);
return current_baud;
#endif
}
void usbuart_set_line_coding(struct usb_cdc_line_coding *coding)