Configuration Guide

All compile-time options are controlled in src/xelpcfg.h. Comment in or out #define lines to enable or disable features. Each feature that is compiled out saves code space.

Feature flags

FlagPurposeSize impact
XELP_ENABLE_CLICommand line mode with prompt, backspace, and command dispatchRequired for CLI and scripting
XELP_ENABLE_KEYSingle key press mode (menus, immediate actions)~200–500 bytes
XELP_ENABLE_THRPass-through mode (redirect keys to another peripheral)~50–125 bytes
XELP_ENABLE_HELPBuilt-in help function listing all commands~180–350 bytes
XELP_ENABLE_LCORELanguage core features: peek, poke, goVariable
XELP_ENABLE_FULLEnable all of the aboveAll combined

Key mappings

These define which key presses switch between modes at the command line:

DefineDefaultPurpose
XELPKEY_CLICTRL-P (0x10)Enter CLI mode
XELPKEY_KEYESC (0x1B)Enter KEY mode
XELPKEY_THRCTRL-T (0x14)Enter THRU mode

Override by redefining in xelpcfg.h, e.g. #define XELPKEY_CLI ('c')

Escape characters

DefineDefaultPurpose
XELP_CLI_ESC` (backtick)Escape character at command line / in scripts
XELP_QUO_ESC\ (backslash)Escape character inside quoted strings

Buffer and register sizes

DefineDefaultPurpose
XELP_CMDBUFSZ64Command line buffer size in bytes
XELP_REGS_SZ2Number of integer registers (min 1, R0 is return value)
XELPREGintRegister type (change for platforms where int is not ideal)
XELP_STACK_DEPTH16Stack depth for stack machine operations

Prompt

DefineDefaultPurpose
XELP_CLI_PROMPT"xelp>"String shown at CLI prompt

For per-instance prompts, set to (ths->mpPrompt) and use XELP_SET_VAL_CLI_PROMPT(myXelp, "myPrompt>") at runtime.

Help strings

DefineDefaultPurpose
XELP_HELP_KEY_STR"\nKey functions\n"Header for KEY command help section
XELP_HELP_CLI_STR"\nCLI functions\n"Header for CLI command help section
XELP_HELP_ABT_STR(ths->mpAboutMsg)About message shown at top of help

Config override

If XELP_CONFIG_OVERRIDE is defined before including xelpcfg.h, the file includes xelp_ovr.h instead of using its built-in defaults. This allows project-specific configuration without modifying the library’s xelpcfg.h directly. The 8.3 filename convention is used for compatibility with legacy filesystems.

Example configurations

Minimal (KEY mode only)

/* xelpcfg.h */
#define XELP_ENABLE_KEY   1
/* Leave CLI, THR, HELP, LCORE undefined */

Estimated size: ~900 bytes

CLI with help

#define XELP_ENABLE_CLI   1
#define XELP_ENABLE_HELP  1

Estimated size: ~2 KB

Full

#define XELP_ENABLE_FULL  1

Estimated size: ~3–4 KB (platform dependent)