|
|
@@ -5,6 +5,7 @@ |
|
|
|
#include "avr/pgmspace.h" |
|
|
|
#include <stdarg.h> |
|
|
|
#include "imxrt.h" |
|
|
|
#include "usb_desc.h" |
|
|
|
|
|
|
|
void putchar_debug(char c); |
|
|
|
static void puint_debug(unsigned int num); |
|
|
@@ -70,6 +71,28 @@ static void puint_debug(unsigned int num) |
|
|
|
printf_debug(buf + i); |
|
|
|
} |
|
|
|
|
|
|
|
// first is this normal Serial? |
|
|
|
#if defined(PRINT_DEBUG_USING_USB) && defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) |
|
|
|
#include "usb_dev.h" |
|
|
|
#include "usb_serial.h" |
|
|
|
FLASHMEM void putchar_debug(char c) |
|
|
|
{ |
|
|
|
usb_serial_putchar(c); |
|
|
|
} |
|
|
|
|
|
|
|
FLASHMEM void printf_debug_init(void) {} |
|
|
|
|
|
|
|
#elif defined(PRINT_DEBUG_USING_USB) && defined(SEREMU_INTERFACE) && !defined(CDC_STATUS_INTERFACE) && !defined(CDC_DATA_INTERFACE) |
|
|
|
#include "usb_dev.h" |
|
|
|
#include "usb_seremu.h" |
|
|
|
FLASHMEM void putchar_debug(char c) |
|
|
|
{ |
|
|
|
usb_seremu_putchar(c); |
|
|
|
} |
|
|
|
|
|
|
|
FLASHMEM void printf_debug_init(void) {} |
|
|
|
|
|
|
|
#else |
|
|
|
FLASHMEM void putchar_debug(char c) |
|
|
|
{ |
|
|
|
while (!(LPUART3_STAT & LPUART_STAT_TDRE)) ; // wait |
|
|
@@ -83,7 +106,7 @@ FLASHMEM void printf_debug_init(void) |
|
|
|
LPUART3_BAUD = LPUART_BAUD_OSR(25) | LPUART_BAUD_SBR(8); // ~115200 baud |
|
|
|
LPUART3_CTRL = LPUART_CTRL_TE; |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|