Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
microrlConfig.h
Go to the documentation of this file.
1/*
2Microrl library config files
3Autor: Eugene Samoylov aka Helius (ghelius@gmail.com)
4*/
5#ifndef _MICRORL_CONFIG_H_
6#define _MICRORL_CONFIG_H_
7
8#define MICRORL_LIB_VER "1.5"
9
10/*********** CONFIG SECTION **************/
11/*
12Command line length, define cmdline buffer size. Set max number of chars + 1,
13because last byte of buffer need to contain '\0' - NULL terminator, and
14not use for storing inputed char.
15If user input chars more then it parametrs-1, chars not added to command line.*/
16#define _COMMAND_LINE_LEN (1+100) // for 32 chars
17
18/*
19Command token number, define max token it command line, if number of token
20typed in command line exceed this value, then prints message about it and
21command line not to be parced and 'execute' callback will not calls.
22Token is word separate by white space, for example 3 token line:
23"IRin> set mode test" */
24#define _COMMAND_TOKEN_NMB 30
25
26/*
27Define you prompt string here. You can use colors escape code, for highlight you prompt,
28for example this prompt will green color (if you terminal supports color)*/
29#define _PROMPT_DEFAUTL "\033[32mpprz >\033[0m " // green color
30
31/*
32Define prompt text (without ESC sequence, only text) prompt length, it needs because if you use
33ESC sequence, it's not possible detect only text length*/
34#define _PROMPT_LEN 7
35
36/*Define it, if you wanna use completion functional, also set completion callback in you code,
37now if user press TAB calls 'copmlitetion' callback. If you no need it, you can just set
38NULL to callback ptr and do not use it, but for memory saving tune,
39if you are not going to use it - disable this define.*/
40#define _USE_COMPLETE
41
42/*Define it, if you wanna use history. It s work's like bash history, and
43set stored value to cmdline, if UP and DOWN key pressed. Using history add
44memory consuming, depends from _RING_HISTORY_LEN parametr */
45#define _USE_HISTORY
46
47/*
48History ring buffer length, define static buffer size.
49For saving memory, each entered cmdline store to history in ring buffer,
50so we can not say, how many line we can store, it depends from cmdline len,
51but memory using more effective. We not prefer dinamic memory allocation for
52small and embedded devices. Overhead is 2 char on each saved line*/
53#define _RING_HISTORY_LEN 256
54
55/*
56Enable Handling terminal ESC sequence. If disabling, then cursor arrow, HOME, END will not work,
57use Ctrl+A(B,F,P,N,A,E,H,K,U,C) see README, but decrease code memory.*/
58#define _USE_ESC_SEQ
59
60/*
61Use snprintf from you standard complier library, but it gives some overhead.
62If not defined, use my own u16int_to_str variant, it's save about 800 byte of code size
63on AVR (avr-gcc build).
64Try to build with and without, and compare total code size for tune library.
65*/
66//#define _USE_LIBC_STDIO
67
68/*
69Enable 'interrupt signal' callback, if user press Ctrl+C */
70#define _USE_CTLR_C
71
72/*
73Print prompt at 'microrl_init', if enable, prompt will print at startup,
74otherwise first prompt will print after first press Enter in terminal
75NOTE!: Enable it, if you call 'microrl_init' after your communication subsystem
76already initialize and ready to print message */
77#undef _ENABLE_INIT_PROMPT
78
79/*
80New line symbol */
81#define _ENDL_CR
82
83#if defined(_ENDL_CR)
84#define ENDL "\r\n"
85#elif defined(_ENDL_CRLF)
86#define ENDL "\r\n"
87#elif defined(_ENDL_LF)
88#define ENDL "\n"
89#elif defined(_ENDL_LFCR)
90#define ENDL "\n\r"
91#else
92#error "You must define new line symbol."
93#endif
94
95/********** END CONFIG SECTION ************/
96
97
98#if _RING_HISTORY_LEN > 256
99#error "This history implementation (ring buffer with 1 byte iterator) allow 256 byte buffer size maximum"
100#endif
101
102#endif