Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log.h 682B

12345678910111213141516171819202122232425
  1. /*
  2. * log.h
  3. */
  4. #ifndef __LOG_H__
  5. #define __LOG_H__
  6. // for output that is stored in the debug log.
  7. // will be re-played from buffer when terminal connects
  8. #define debug(fmt, ...) debug_log(true, \
  9. "%08lu %s: " fmt "\r\n", \
  10. to_ms_since_boot(get_absolute_time()), \
  11. __func__, \
  12. ##__VA_ARGS__)
  13. // for interactive output. is not stored or re-played.
  14. #define print(fmt, ...) debug_log(false, fmt, ##__VA_ARGS__)
  15. #define println(fmt, ...) debug_log(false, fmt "\r\n", ##__VA_ARGS__)
  16. void debug_log(bool log, const char *format, ...) __attribute__((format(printf, 2, 3)));
  17. void log_dump_to_usb(void);
  18. void log_dump_to_disk(void);
  19. #endif // __LOG_H__