Browse Source
размером кратным буферу (8К). Настройки в конфигурации для работы UART с октопринт и т.д.pull/1/head
Sergey
5 years ago
8 changed files with 110 additions and 20 deletions
@ -0,0 +1,28 @@ |
|||||
|
#include "debug_to_uart.h" |
||||
|
|
||||
|
|
||||
|
void debug_to_uart(char *fmt,...){ |
||||
|
|
||||
|
char buffer[200]; |
||||
|
va_list ParamList; |
||||
|
char *ptr = (char *)buffer; |
||||
|
|
||||
|
buffer[0] = ';'; |
||||
|
buffer[1] = ' '; |
||||
|
|
||||
|
va_start(ParamList, fmt); |
||||
|
vsnprintf (buffer+2, 199, fmt, ParamList); |
||||
|
va_end(ParamList); |
||||
|
|
||||
|
//SERIAL_ECHOLN((char *)&buffer);
|
||||
|
|
||||
|
while(*ptr){ |
||||
|
while(MYSERIAL0.availableForWrite()==0){ |
||||
|
safe_delay(10); |
||||
|
} |
||||
|
MYSERIAL0.write(*ptr++); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
#ifndef DEBUG_UART_H |
||||
|
#define DEBUG_UART_H |
||||
|
|
||||
|
#include "../../MarlinCore.h" |
||||
|
#include "../../inc/MarlinConfig.h" |
||||
|
|
||||
|
void debug_to_uart(char *fmt,...); |
||||
|
|
||||
|
#endif |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue