fw: simplify how to enable QEMU debug in firmware.

- Remove the define `NOCONSOLE`, add define `QEMU_CONSOLE`
- Inverse the use of it, add the define to have QEMU debug output in fw.
- Add a make target `qemu_firmware.elf` which builds the firmware with
  QEMU console enabled.

Co-authored-by: Mikael Ågren <mikael@tillitis.se>
This commit is contained in:
Daniel Jobson 2024-09-06 12:46:18 +02:00 committed by Michael Cardell Widerkrantz
parent 35052e50cb
commit 613316f53e
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
4 changed files with 24 additions and 18 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 - Tillitis AB
* Copyright (C) 2022-2024 - Tillitis AB
* SPDX-License-Identifier: GPL-2.0-only
*/
@ -8,21 +8,21 @@
#include "types.h"
#ifdef NOCONSOLE
#define htif_putc(ch)
#define htif_lf()
#define htif_puthex(c)
#define htif_putinthex(n)
#define htif_puts(s)
#define htif_hexdump(buf, len)
#else
#ifdef QEMU_CONSOLE
void htif_putc(char ch);
void htif_lf();
void htif_puthex(uint8_t c);
void htif_putinthex(const uint32_t n);
void htif_puts(const char *s);
void htif_hexdump(void *buf, int len);
#endif
#else
#define htif_putc(ch)
#define htif_lf()
#define htif_puthex(c)
#define htif_putinthex(n)
#define htif_puts(s)
#define htif_hexdump(buf, len)
#endif /* QEMU_CONSOLE */
void *memset(void *dest, int c, unsigned n);
void memcpy_s(void *dest, size_t destsize, const void *src, size_t n);