- 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
This commit is contained in:
hathach
2024-05-21 16:08:27 +07:00
parent 4bd72da5cd
commit 953e3bd634
4 changed files with 54 additions and 64 deletions

View File

@@ -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];

View File

@@ -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;
}