samd: convert_tdio command cleaned up
This commit is contained in:
parent
4aee9fe2a3
commit
84b6818982
@ -316,14 +316,9 @@ static bool cmd_convert_tdio(target *t, int argc, const char **argv)
|
|||||||
{
|
{
|
||||||
(void)t;
|
(void)t;
|
||||||
(void) argc;
|
(void) argc;
|
||||||
|
(void) argv;
|
||||||
|
|
||||||
uint32_t res = 0;
|
usbuart_convert_tdio(0);
|
||||||
|
|
||||||
if (argc > 1)
|
|
||||||
res = usbuart_convert_tdio(atoi(argv[1]));
|
|
||||||
else
|
|
||||||
res = usbuart_convert_tdio(0);
|
|
||||||
gdb_outf("BAUD: %d\n", res);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ void usbuart_init(void)
|
|||||||
//usart_enable(USART_NUM, current_baud);
|
//usart_enable(USART_NUM, current_baud);
|
||||||
usart_setup(USART_NUM, current_baud);
|
usart_setup(USART_NUM, current_baud);
|
||||||
#ifndef DEBUG_ME
|
#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
|
#endif
|
||||||
usart_enable(USART_NUM, 0); /* baud==0 so setup is skipped */
|
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)
|
int usbuart_convert_tdio(uint32_t arg)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
|
|
||||||
(void) arg;
|
(void) arg;
|
||||||
|
|
||||||
@ -130,18 +129,6 @@ int usbuart_convert_tdio(uint32_t arg)
|
|||||||
|
|
||||||
return current_baud;
|
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)
|
void usbuart_set_line_coding(struct usb_cdc_line_coding *coding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user