123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
-
-
- #ifndef __LOG_H__
- #define __LOG_H__
-
- #include <stdarg.h>
- #include <stdbool.h>
- #include "pico/stdlib.h"
-
-
-
- #define debug(fmt, ...) debug_log(true, \
- "%08lu %s: " fmt "\r\n", \
- to_ms_since_boot(get_absolute_time()), \
- __func__, \
- ##__VA_ARGS__)
-
-
- #define print(fmt, ...) debug_log(false, fmt, ##__VA_ARGS__)
- #define println(fmt, ...) debug_log(false, fmt "\r\n", ##__VA_ARGS__)
-
- void debug_log(bool log, const char *format, ...) __attribute__((format(printf, 2, 3)));
- void debug_wait_input(const char *format, ...) __attribute__((format(printf, 1, 2)));
- void debug_log_va(bool log, const char *format, va_list args);
-
- void log_dump_to_usb(void);
- void log_dump_to_uart(void);
- void log_dump_to_disk(void);
-
- void debug_handle_input(const void *buff, size_t len);
-
- #endif
|