summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-05-21 16:08:27 +0700
committerhathach <[email protected]>2024-05-21 17:50:50 +0700
commit953e3bd6344812c910f714952b4dda47ffe53107 (patch)
treec24ca7c87c64fcecce628af5a8b294b9f83b30c2 /hw
parent4bd72da5cdce4b3ab8f5a9960234a97934672f1c (diff)
- minor update to ep_set_response_and_toggle/xfer_data_packet
- merge USBHS_ISO_ACT_FLAG, USBHS_TRANSFER_FLAG handler since they are similar - improve uart output - add note for link speed in bus reset
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/ch32v307/debug_uart.c2
-rw-r--r--hw/bsp/ch32v307/family.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/hw/bsp/ch32v307/debug_uart.c b/hw/bsp/ch32v307/debug_uart.c
index db3551ca7..fbabeeadc 100644
--- a/hw/bsp/ch32v307/debug_uart.c
+++ b/hw/bsp/ch32v307/debug_uart.c
@@ -28,7 +28,7 @@
#include <ch32v30x.h>
-#define UART_RINGBUFFER_SIZE_TX 64
+#define UART_RINGBUFFER_SIZE_TX 128
#define UART_RINGBUFFER_MASK_TX (UART_RINGBUFFER_SIZE_TX-1)
static char tx_buf[UART_RINGBUFFER_SIZE_TX];
diff --git a/hw/bsp/ch32v307/family.c b/hw/bsp/ch32v307/family.c
index fe37ea8e3..94578b416 100644
--- a/hw/bsp/ch32v307/family.c
+++ b/hw/bsp/ch32v307/family.c
@@ -72,7 +72,7 @@ void board_init(void) {
SysTick_Config(SystemCoreClock / 1000);
#endif
- usart_printf_init(115200);
+ usart_printf_init(CFG_BOARD_UART_BAUDRATE);
#if CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED
// Use Highspeed USB
@@ -150,10 +150,11 @@ int board_uart_read(uint8_t* buf, int len) {
int board_uart_write(void const* buf, int len) {
int txsize = len;
+ const char* bufc = (const char*) buf;
while (txsize--) {
- uart_write(*(uint8_t const*) buf);
- buf++;
+ uart_write(*bufc++);
}
+ uart_sync();
return len;
}