blob: ada4aa2ea42f2d784f7002650496b9f8414fdb59 [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 Georged3ebe482014-01-07 15:20:33 +000042// Whether to build code to show byte code
43#ifndef MICROPY_SHOW_BC
44#define MICROPY_SHOW_BC (0)
45#endif
46
Damien George136f6752014-01-07 14:54:15 +000047/*****************************************************************************/
48/* Fine control over Python features */
49
Damien Georged3ebe482014-01-07 15:20:33 +000050// Whether to include the garbage collector
51#ifndef MICROPY_ENABLE_GC
52#define MICROPY_ENABLE_GC (0)
53#endif
54
Damien George136f6752014-01-07 14:54:15 +000055// Whether to include REPL helper function
56#ifndef MICROPY_ENABLE_REPL_HELPERS
57#define MICROPY_ENABLE_REPL_HELPERS (0)
58#endif
59
Damien Georged3ebe482014-01-07 15:20:33 +000060// Whether to include lexer helper function for unix
61#ifndef MICROPY_ENABLE_LEXER_UNIX
62#define MICROPY_ENABLE_LEXER_UNIX (0)
63#endif
64
Paul Sokolovsky48b35722014-01-12 17:30:48 +020065// Long int implementation
66#define MICROPY_LONGINT_IMPL_NONE (0)
67#define MICROPY_LONGINT_IMPL_LONGLONG (1)
68
69#ifndef MICROPY_LONGINT_IMPL
70#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
71#endif
72
73#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG
74typedef long long mp_longint_impl_t;
75#endif
76
Damien George136f6752014-01-07 14:54:15 +000077// Whether to support float and complex types
78#ifndef MICROPY_ENABLE_FLOAT
79#define MICROPY_ENABLE_FLOAT (0)
80#endif
81
82// Whether to support slice object and correspondingly
83// slice subscript operators
84#ifndef MICROPY_ENABLE_SLICE
85#define MICROPY_ENABLE_SLICE (1)
86#endif
87
88/*****************************************************************************/
89/* Miscellaneous settings */
90
Paul Sokolovskyfc5aac82014-01-12 16:10:19 +020091#define BITS_PER_BYTE (8)
92#define BITS_PER_WORD (BITS_PER_BYTE * BYTES_PER_WORD)
Paul Sokolovskyc260bc52014-01-12 16:15:47 +020093// machine_int_t value with most significant bit set
94#define WORD_MSBIT_HIGH (1 << (BYTES_PER_WORD * 8 - 1))
Paul Sokolovskyfc5aac82014-01-12 16:10:19 +020095
Paul Sokolovskyc90c0f62014-01-04 01:57:00 +020096// printf format spec to use for machine_int_t and friends
Damien George136f6752014-01-07 14:54:15 +000097#ifndef INT_FMT
Paul Sokolovskyc90c0f62014-01-04 01:57:00 +020098#ifdef __LP64__
99// Archs where machine_int_t == long, long != int
100#define UINT_FMT "%lu"
101#define INT_FMT "%ld"
102#else
103// Archs where machine_int_t == int
104#define UINT_FMT "%u"
105#define INT_FMT "%d"
106#endif
107#endif //INT_FMT