From e75fb7c47b640ea329984d95fc9f4b2d7cd3efe4 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 9 Apr 2016 10:56:10 +0200 Subject: because arduino is sooooooo frustrating Signed-off-by: Olivier Gayot --- sketch_apr09a/logs.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sketch_apr09a/logs.h (limited to 'sketch_apr09a/logs.h') diff --git a/sketch_apr09a/logs.h b/sketch_apr09a/logs.h new file mode 100644 index 0000000..4124d03 --- /dev/null +++ b/sketch_apr09a/logs.h @@ -0,0 +1,37 @@ +#ifndef LOGS_H +#define LOGS_H + +#include + +#if 0 +enum { + OPCODE_LOGS = 0x89, + OPCODE_OK = 0x70, + OPCODE_ERR = 0x70, +}; + +#define serial_log serial_log_puts + +#define serial_log_puts(_str) serial_puts(OPCODE_LOGS, _str); +#define serial_log_print_dec(_int) serial_print_dec(OPCODE_LOGS, _int) +#define serial_log_print_hex(_int) serial_print_dec(OPCODE_LOGS, _int) + +#define serial_ok(_str) serial_puts(OPCODE_OK, _str); +#define serial_err(_str) serial_puts(OPCODE_ERR, _str); + +#endif + +int serial_puts(const char *str); +int serial_put_string(const char *str); +int serial_write(uint8_t value); +int serial_printf(const char *str, ...); + +#if 0 +int serial_print_dec(uint8_t opcode, int32_t integer); +int serial_print_hex(uint8_t opcode, int32_t integer); +#endif + +#endif + + + -- cgit v1.2.3