Commit 545e849d authored by schneider's avatar schneider
Browse files

hack(ble): Also print stuff on USB uart

parent e38234a1
...@@ -170,6 +170,7 @@ int __read(int file, unsigned char *ptr, size_t len) ...@@ -170,6 +170,7 @@ int __read(int file, unsigned char *ptr, size_t len)
return num; return num;
} }
__attribute__((weak)) void cdcacm_write(uint8_t *data, int len);
/* newlib/libc printf() will eventually call write() to get the data to the stdout */ /* newlib/libc printf() will eventually call write() to get the data to the stdout */
#if defined ( __GNUC__ ) #if defined ( __GNUC__ )
// GNUC _write function prototype // GNUC _write function prototype
...@@ -190,7 +191,10 @@ int __write(int file, const unsigned char *ptr, size_t len) ...@@ -190,7 +191,10 @@ int __write(int file, const unsigned char *ptr, size_t len)
for (n = 0; n < len; n++) { for (n = 0; n < len; n++) {
if (*ptr == '\n') { if (*ptr == '\n') {
UART_WriteByte(MXC_UARTn,'\r'); UART_WriteByte(MXC_UARTn,'\r');
uint8_t tmp = '\r';
cdcacm_write(&tmp, 1);
} }
cdcacm_write(ptr, 1);
UART_WriteByte(MXC_UARTn,*ptr++); UART_WriteByte(MXC_UARTn,*ptr++);
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment