CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1/// @file Config.h
2/// @brief The CHGame library's build switches.
3///
4/// The library is compiled on its own, so it cannot see a sketch's config.h:
5/// set these with build.extra_flags (chgame build --debug passes
6/// -DCHGAME_DEBUG=1), and read them in the sketch from here.
7#pragma once
8
9/// @defgroup chgame_config Build switches
10/// @ingroup lib_chgame
11/// @brief CHGAME_DEBUG and CHGAME_PROFILE: set them with build.extra_flags.
12///
13/// | Switch | Default | What it turns on |
14/// |---|---|---|
15/// | `CHGAME_DEBUG` | 0 on the board, 1 in the simulator | the serial debug protocol (@ref chgame_debug): screenshots, input injection, lockstep, perf. Always on in the simulator, which is driven through it; off on the board unless asked for (it costs ~2 KB and needs USB Serial). |
16/// | `CHGAME_PROFILE` | 0 | the section profiler (dbg::prof() and the `T` command) |
17///
18/// @code
19/// arduino-cli compile --build-property build.extra_flags=-DCHGAME_DEBUG=1 ...
20/// @endcode
21/// (`chgame build --debug` does this.) A sketch can test them too, as
22/// `#if CHGAME_DEBUG`, to leave things out of its debug build.
23/// @{
24
25// CHGAME_DEBUG: the serial debug protocol (chgame/Debug.h).
26#ifndef CHGAME_DEBUG
27#ifdef CHSIM
28#define CHGAME_DEBUG 1
29#else
30#define CHGAME_DEBUG 0
31#endif
32#endif
33
34// CHGAME_PROFILE: the section profiler (dbg::prof and the T command).
35#ifndef CHGAME_PROFILE
36#define CHGAME_PROFILE 0
37#endif
38
39/// @}