1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12
13#pragma once
14
15#include <stdbool.h>
16#include <stdio.h>
17
18#define PRINT_ONCE(...) ({ \
19                        static bool __printed = 0; \
20                        if(!__printed) { \
21                            printf(__VA_ARGS__); \
22                            __printed=1; \
23                        } \
24                        })
25
26/**
27 * Display memory content to screen
28 * @param[in] address   The start address of memory
29 * @param[in] bytes     The number of bytes to print
30 * @param[in] word_size The number of bytes in a displayed word
31 */
32void utils_memory_dump(void* address, size_t bytes, int word_size);
33