Simplified printf implementation. More...
#include "sersendf.h"#include <stdarg.h>#include <avr/pgmspace.h>#include "serial.h"#include "sermsg.h"Functions | |
| void | sersendf_P (PGM_P format,...) |
| Simplified printf. | |
Variables | |
| PGM_P | str_ox = "0x" |
| for sending hex data | |
Simplified printf implementation.
| void sersendf_P | ( | PGM_P | format, |
| ... | |||
| ) |
Simplified printf.
| format | pointer to output format specifier string stored in FLASH. |
| ... | output data |
Implements only a tiny subset of printf's format specifiers :-
%[ls][udcx%]
l - following data is (32 bits)
s - following data is short (8 bits)
none - following data is 16 bits.
u - unsigned int
d - signed int
c - character
x - hex
% - send a literal % character
Example:
sersendf_P(PSTR("X:%ld Y:%ld temp:%u.%d flags:%sx Q%su/%su%c\n"), target.X, target.Y, current_temp >> 2, (current_temp & 3) * 25, dda.allflags, mb_head, mb_tail, (queue_full()?'F':(queue_empty()?'E':' ')))
Referenced by clock_250ms(), dda_create(), gcode_parse_char(), heater_print(), heater_set(), heater_tick(), print_queue(), process_gcode_command(), temp_print(), and temp_sensor_tick().
1.7.2