@@ -37,21 +37,18 @@ int pbdrv_uart_debug_next_char(void) {
3737/**
3838 * Formats and stores a string in the UART debug ring buffer.
3939 *
40- * This function works similarly to vprintf, but instead of printing to the
41- * standard output. The formatted string will be written to the UART when the
40+ * The formatted string will be written to the UART when the
4241 * buffer is processed.
4342 *
4443 * @param format The format string, similar to printf.
4544 * @param va_list The variable arguments, as a va_list.
4645 */
47- void pbdrv_uart_debug_vprintf (const char * format , va_list args ) {
46+ void pbdrv_uart_debug_print (const char * data , size_t len ) {
4847 if (!lwrb_is_ready (& ring_buffer )) {
4948 lwrb_init (& ring_buffer , ring_buf_storage , sizeof (ring_buf_storage ));
5049 }
5150
52- char buf [256 ];
53- size_t len = vsnprintf (buf , sizeof (buf ), format , args );
54- lwrb_write (& ring_buffer , (const uint8_t * )buf , len );
51+ lwrb_write (& ring_buffer , (const uint8_t * )data , len );
5552
5653 if (!debug_uart ) {
5754 // Not initialized yet, so just buffer for now.
@@ -62,23 +59,6 @@ void pbdrv_uart_debug_vprintf(const char *format, va_list args) {
6259 pbio_os_request_poll ();
6360}
6461
65- /**
66- * Formats and stores a string in the UART debug ring buffer.
67- *
68- * This function works similarly to printf, but instead of printing to the
69- * standard output. The formatted string will be written to the UART when the
70- * buffer is processed.
71- *
72- * @param format The format string, similar to printf.
73- * @param ... The variable arguments, similar to printf.
74- */
75- void pbdrv_uart_debug_printf (const char * format , ...) {
76- va_list args ;
77- va_start (args , format );
78- pbdrv_uart_debug_vprintf (format , args );
79- va_end (args );
80- }
81-
8262/**
8363 * Gets a character from the UART debug port.
8464 *
0 commit comments