blob: 00e2439e4d0fc246a7345bfc3f00ab259e63ae70 [file] [log] [blame]
Paul Sokolovskyb372bfc2014-01-03 17:15:53 +02001// This file contains default configuration settings for MicroPython.
2// You can override any of these options using mpconfigport.h file located
3// in a directory of your port.
4
5#include <mpconfigport.h>
6
Damien George136f6752014-01-07 14:54:15 +00007// Any options not explicitly set in mpconfigport.h will get default
8// values below.
9
10/*****************************************************************************/
11/* Micro Python emitters */
12
13// Whether to emit CPython byte codes (for debugging/testing)
14// Enabling this overrides all other emitters
15#ifndef MICROPY_EMIT_CPYTHON
16#define MICROPY_EMIT_CPYTHON (0)
17#endif
18
19// Whether to emit x64 native code
20#ifndef MICROPY_EMIT_X64
21#define MICROPY_EMIT_X64 (0)
22#endif
23
24// Whether to emit thumb native code
25#ifndef MICROPY_EMIT_THUMB
26#define MICROPY_EMIT_THUMB (0)
27#endif
28
29// Whether to enable the thumb inline assembler
30#ifndef MICROPY_EMIT_INLINE_THUMB
31#define MICROPY_EMIT_INLINE_THUMB (0)
32#endif
33
34/*****************************************************************************/
35/* Internal debugging stuff */
36
37// Whether to collect memory allocation stats
38#ifndef MICROPY_MEM_STATS
39#define MICROPY_MEM_STATS (0)
40#endif
41
Damien Georgecbd2f742014-01-19 11:48:48 +000042// Whether to build functions that print debugging info:
Damien Georgec5966122014-02-15 16:10:44 +000043// mp_token_show
Damien Georgecbd2f742014-01-19 11:48:48 +000044// mp_byte_code_print
45// mp_parse_node_print
46#ifndef MICROPY_DEBUG_PRINTERS
47#define MICROPY_DEBUG_PRINTERS (0)
Damien Georged3ebe482014-01-07 15:20:33 +000048#endif
49
Damien George136f6752014-01-07 14:54:15 +000050/*****************************************************************************/
51/* Fine control over Python features */
52
Damien Georged3ebe482014-01-07 15:20:33 +000053// Whether to include the garbage collector
54#ifndef MICROPY_ENABLE_GC
55#define MICROPY_ENABLE_GC (0)
56#endif
57
Damien George136f6752014-01-07 14:54:15 +000058// Whether to include REPL helper function
59#ifndef MICROPY_ENABLE_REPL_HELPERS
60#define MICROPY_ENABLE_REPL_HELPERS (0)
61#endif
62
Damien Georged3ebe482014-01-07 15:20:33 +000063// Whether to include lexer helper function for unix
64#ifndef MICROPY_ENABLE_LEXER_UNIX
65#define MICROPY_ENABLE_LEXER_UNIX (0)
66#endif
67
Paul Sokolovsky48b35722014-01-12 17:30:48 +020068// Long int implementation
69#define MICROPY_LONGINT_IMPL_NONE (0)
70#define MICROPY_LONGINT_IMPL_LONGLONG (1)
71
72#ifndef MICROPY_LONGINT_IMPL
73#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
74#endif
75
76#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG
77typedef long long mp_longint_impl_t;
78#endif
79
Damien George62ad1892014-01-29 21:51:51 +000080// Whether to include information in the byte code to determine source
81// line number (increases RAM usage, but doesn't slow byte code execution)
82#ifndef MICROPY_ENABLE_SOURCE_LINE
83#define MICROPY_ENABLE_SOURCE_LINE (0)
84#endif
85
Damien George136f6752014-01-07 14:54:15 +000086// Whether to support float and complex types
87#ifndef MICROPY_ENABLE_FLOAT
88#define MICROPY_ENABLE_FLOAT (0)
89#endif
90
91// Whether to support slice object and correspondingly
92// slice subscript operators
93#ifndef MICROPY_ENABLE_SLICE
94#define MICROPY_ENABLE_SLICE (1)
95#endif
96
Paul Sokolovskydcac8802014-01-16 19:19:50 +020097// Enable features which improve CPython compatibility
98// but may lead to more code size/memory usage.
99// TODO: Originally intended as generic category to not
100// add bunch of once-off options. May need refactoring later
101#ifndef MICROPY_CPYTHON_COMPAT
102#define MICROPY_CPYTHON_COMPAT (1)
103#endif
104
Damien George354d15a2014-02-06 21:11:19 +0000105// Maximum length of a path in the filesystem
106// So we can allocate a buffer on the stack for path manipulation in import
107#ifndef MICROPY_PATH_MAX
108#define MICROPY_PATH_MAX (512)
109#endif
110
Paul Sokolovsky910843e2014-02-14 12:02:34 +0200111// Additional builtin function definitions - see runtime.c:builtin_table for format.
112#ifndef MICROPY_EXTRA_BUILTINS
113#define MICROPY_EXTRA_BUILTINS
114#endif
Damien George136f6752014-01-07 14:54:15 +0000115/*****************************************************************************/
116/* Miscellaneous settings */
117
Paul Sokolovskyd5df6cd2014-02-12 18:15:40 +0200118// Allow to override static modifier for global objects, e.g. to use with
119// object code analysis tools which don't support static symbols.
120#ifndef STATIC
121#define STATIC static
122#endif
123
Paul Sokolovskyfc5aac82014-01-12 16:10:19 +0200124#define BITS_PER_BYTE (8)
125#define BITS_PER_WORD (BITS_PER_BYTE * BYTES_PER_WORD)
Paul Sokolovskyc260bc52014-01-12 16:15:47 +0200126// machine_int_t value with most significant bit set
Damien George23005372014-01-13 19:39:01 +0000127#define WORD_MSBIT_HIGH (((machine_uint_t)1) << (BYTES_PER_WORD * 8 - 1))
Paul Sokolovskyfc5aac82014-01-12 16:10:19 +0200128
Paul Sokolovskyc90c0f62014-01-04 01:57:00 +0200129// printf format spec to use for machine_int_t and friends
Damien George136f6752014-01-07 14:54:15 +0000130#ifndef INT_FMT
Paul Sokolovskyc90c0f62014-01-04 01:57:00 +0200131#ifdef __LP64__
132// Archs where machine_int_t == long, long != int
133#define UINT_FMT "%lu"
134#define INT_FMT "%ld"
135#else
136// Archs where machine_int_t == int
137#define UINT_FMT "%u"
138#define INT_FMT "%d"
139#endif
140#endif //INT_FMT