ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
debug.c
Go to the documentation of this file.
1 
23 #include "user_config.h"
24 
25 #include <stdint.h>
26 #include <stdarg.h>
27 #include <string.h>
28 #include <math.h>
29 
30 #include "mathio.h"
31 #include "debug.h"
32 
37 static void _uart0_fn(struct _printf_t *p, char ch)
38 {
39  p->sent++;
40 //FIXME
41  //uart_putc(0, ch);
42 #ifdef UART_QUEUED_TX
43  uart_queue_putc(0, ch);
44 #else
45  uart_putc(0, ch);
46 #endif
47 }
48 
54 int uart0_printf(const char *format, ...)
55 {
56  int len;
57  int i;
58  printf_t fn;
59 
60  va_list va;
61 
62  fn.put = _uart0_fn;
63  fn.sent = 0;
64 
65  va_start(va, format);
66  _printf_fn(&fn, format, va);
67  va_end(va);
68 
69  len = fn.sent;
70 
71  //uart_tx_flush(0);
72 
73  return len;
74 }
Master include file for project Includes all project includes and defines here.
Small printf user function.
MEMSPACE void uart_queue_putc(uint8_t uart_no, char c)
MEMSPACE void _printf_fn(printf_t *fn, __memx const char *fmt, va_list va)
vsnprintf function
Definition: printf.c:741
static void _uart0_fn(struct _printf_t *p, char ch)
_uart0_fn low level function that writes a character with uart0har()
Definition: debug.c:37
MEMSPACE int uart0_printf(const char *format,...)
printf function
Definition: debug.c:54
MEMSPACE int uart_putc(uint8 uart_no, char c)
Write a byte from a uart with NL to CR/NL conversion Note: This function waits/blocks util the write ...
Definition: uart.c:323
Math IO functions, and verious conversion code with floating point support.
#define MEMSPACE
Definition: cpu.h:25
int sent
Definition: mathio.h:86
void(* put)(struct _printf_t *, char)
Definition: mathio.h:83
undefine any potential macro version of these functions
Definition: mathio.h:81