mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-04-26 01:49:18 -04:00

This is an import of the fw-2 tag of tkey-libs. We import the entire tkey-libs repo minus dot files into the tillitis-key1 repo to make it very simple not to make mistakes regarding which firmware tag depends on which tkey-libs tag, especially considering locking down with NVCM. Please see README for information about developing with another tkey-libs or how to import future tkey-libs. Since tkey-libs is now a part of the repo we also add tkey-libs to the clean_fw target.
40 lines
998 B
C
40 lines
998 B
C
// SPDX-FileCopyrightText: 2023 Tillitis AB <tillitis.se>
|
|
// SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#ifndef TKEY_DEBUG_H
|
|
#define TKEY_DEBUG_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "io.h"
|
|
|
|
#if defined(QEMU_DEBUG)
|
|
#define debug_putchar(ch) putchar(IO_QEMU, ch)
|
|
#define debug_lf() putchar(IO_QEMU, '\n')
|
|
#define debug_putinthex(ch) putinthex(IO_QEMU, ch)
|
|
#define debug_puts(s) puts(IO_QEMU, s)
|
|
#define debug_puthex(ch) puthex(IO_QEMU, ch)
|
|
#define debug_hexdump(buf, len) hexdump(IO_QEMU, buf, len)
|
|
|
|
#elif defined(TKEY_DEBUG)
|
|
|
|
#define debug_putchar(ch) putchar(IO_TKEYCTRL, ch)
|
|
#define debug_lf() putchar(IO_TKEYCTRL, '\n')
|
|
#define debug_putinthex(ch) putinthex(IO_TKEYCTRL, ch)
|
|
#define debug_puts(s) puts(IO_TKEYCTRL, s)
|
|
#define debug_puthex(ch) puthex(IO_TKEYCTRL, ch)
|
|
#define debug_hexdump(buf, len) hexdump(IO_TKEYCTRL, buf, len)
|
|
|
|
#else
|
|
|
|
#define debug_putchar(ch)
|
|
#define debug_lf()
|
|
#define debug_putinthex(n)
|
|
#define debug_puts(s)
|
|
#define debug_puthex(ch)
|
|
#define debug_hexdump(buf, len)
|
|
|
|
#endif
|
|
|
|
#endif
|